-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error saving a serializable List #52
Comments
Seems related to #43. With snakeyaml ...
peoples:
- *id001
- ==: org.simpleyaml.examples.Person
dni: 12345678B
name: Maria
birthYear: 1990
isAlive: true This is valid YAML because This was the prior default behaviour, but it was changed in 1.7.1 to improve indentation consistency, so now With newer versions of snakeyaml it seems to be a valid alternative for lists of maps using the same value for both indent and list indentation (snakeyaml issue 416), so I will update the default options to set this An |
You are right!
Is a valid YML, But peoples:
- *id001
-
==: org.simpleyaml.examples.Person
dni: 12345678B
name: Maria
birthYear: 1990
isAlive: true is not! I think for now is easier to add an option to YamlConfigurationOptions to set setIndicatorIndent |
I have just released 1.7.3 with the It is still 2 by default, but now it should work properly for serialized objects and maps with the You can set Now your example output is valid YAML without any addition: test:
people:
12345678A: &id001
==: org.simpleyaml.examples.Person
dni: 12345678A
name: John
birthYear: 1990
isAlive: true
peoples:
- *id001
- ==: org.simpleyaml.examples.Person
dni: 12345678B
name: Maria
birthYear: 1990
isAlive: true |
Thankyou, its properly fixed :D |
Saving a serializable List will generate a corrupted yml file.
For example, editing this test over here
https://github.com/Carleslc/Simple-YAML/blob/master/Simple-Yaml/src/test/java/org/simpleyaml/examples/YamlSerializationExample.java#L41-L46
to this:
Will result in this yml.file
Which is not a valid YAMLfile! Its missing indentation on it.
It should be something like this:
From what i tested, loading a serializable list after manully fixing this identation problem works normaly.
The text was updated successfully, but these errors were encountered: