4

I am building an intial-data.yml file to test my Play! application, but when I try to load the page, I get an error as it is reading through the intial-data.yml file. It seems to be able to parse the username, firstname, and lastname fields, but when it gets to the email, it spits out the following error:

play.exceptions.YAMLException: null; mapping values are not allowed here (in file /conf/initial-data.yml line 7, column 11)
    at play.test.Fixtures.loadModels(Fixtures.java:234)
    at Bootstrap.doJob(Bootstrap.java:12)
    at play.jobs.Job.doJobWithResult(Job.java:50)
    at play.jobs.Job.call(Job.java:146)
    at Invocation.Job(Play!)
Caused by: mapping values are not allowed here
 in "<reader>", line 7, column 11:
         email:     myemail@gmail.com
              ^

The first entry in my YML file looks like the following:

# Test data

User(Dan):
    username:   Username1
    fname:      John
    lname:      Doe
     email:     myemail@gmail.com
     password:     password1

Does anyone know why this is happening?

Nick
  • 1,417
  • 1
  • 14
  • 21
jbranchaud
  • 5,909
  • 9
  • 45
  • 70
  • See also http://stackoverflow.com/questions/9055371/python-and-pyaml-yaml-scanner-scannererror-mapping-values-are-not-allowed-her – DNA Feb 18 '12 at 23:57

1 Answers1

6

Works OK if you align the columns (email and password have an extra 1-space indent in your example):

# Test data

User(Dan):
    username:   Username1
    fname:      John
    lname:      Doe
    email:     myemail@gmail.com
    password:     password1

This online parser is useful for debugging...

DNA
  • 42,007
  • 12
  • 107
  • 146