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

Incorrect parsing of empty strings as object member names #27

Open
JKSH opened this issue Aug 29, 2017 · 1 comment
Open

Incorrect parsing of empty strings as object member names #27

JKSH opened this issue Aug 29, 2017 · 1 comment

Comments

@JKSH
Copy link

JKSH commented Aug 29, 2017

Version 1.1.10.37

For fun, I unflattened the convoluted document from my comment in #26:

{
	"": {
		"": [
			{
				"": "",
				"txDefinition": {
					"repeatRate": 0,
					"canPort": 0,
					"messageId": 0
				}
			}
		]
	}
}

When I re-flatten this again, I get:

[
        [
        [
                        [
                "",
                {
                    "repeatRate":0,
                    "canPort":0,
                    "messageId":0
                }
            ]
        ]
    ]
]

Objects have been transformed into arrays.

Also, notice the weird indentation of the innermost and 2nd-innermost arrays at the output.


The output is correct if I replace the empty names ("") with non-empty ones.

See https://stackoverflow.com/questions/33254385/can-a-json-name-value-pair-have-an-empty-name -- Empty strings are valid names for object members.

@JKSH JKSH changed the title Incorrect parsing of unnamed members Incorrect parsing of empty strings as object member names Aug 29, 2017
@jimkring
Copy link
Contributor

jimkring commented Sep 20, 2017

@JKSH For what it's worth, I think we've resolved the "weird indentation" issue #31

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

2 participants