Skip to content
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

Invalid serialization if single double quotation mark is present #2

Open
BoomEaro opened this issue Oct 18, 2023 · 0 comments
Open

Comments

@BoomEaro
Copy link

If you insert only one double quotation mark in the field like this:

test-section:
  # Some description for this test value1
  value-test: "
  # Some description for this test value2
  value-test-2: "test2"

The result of the serialization will be as follows:

test-section:
  # Some description for this test value1
  value-test: " # Some description for this test value2 value-test-2: "
  # Some description for this test value2
  value-test-2: "test2"

It looks like reader keeps looking for the next double quote even when the next field starts.

Configuration used:

public class TestSettings extends YamlSerializable {

    @Transient
    private static final SerializerConfig CONFIG = new SerializerConfig.Builder()
            .setCommentValueIndent(1)
            .build();
    @Transient
    public static final TestSettings IMP = new TestSettings();

    public TestSettings() {
        super(CONFIG);
    }

    public TEST_SECTION TEST_SECTION = new TEST_SECTION();

    public static class TEST_SECTION {

        @Comment(value = {
                @CommentValue("Some description for this test value1"),
        }, at = Comment.At.PREPEND)
        public String VALUE_TEST = "test1";

        @Comment(value = {
                @CommentValue("Some description for this test value2"),
        }, at = Comment.At.PREPEND)
        public String VALUE_TEST2 = "test2";

    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant