Skip to content

Incorrect parsing of empty strings as object member names #27

@JKSH

Description

@JKSH

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions