I am trying to load data from a YAML file where some fields contain "null" values. Play Framework throws the following exception when it tries to parse a "null" value:
"play.exceptions.YAMLException: null; mapping values are not allowed here".
The following is a sample of the data I am trying to import:
person(0)
name:F1
father:
and the model:
public class Person extends Model {
public String name;
public Long father;
}
You can see from the data sample that the "father" field has a "null" value. The father field is an "ID" to another person. How can I make Play accept it?
P.S: I have the "father" field as data type "Long" for technical reasons, so please don't advice me to make it a "Person" type.
Just leave it out of the yaml file. e.g this should work
person(0)
name:F1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With