I am testing my JSON code with sample.json from the test suite here and it contains a lot of name-value pairs where the name is just an empty string, i.e. "". Is this correct? RFC4627 just states that the name SHOULD be unique but does not mention empty names.
The specification defines objects as such:
object
    {}
    { members }
members
    pair
    pair , members
pair
    string : value
    array
string
    ""
    " chars "
In other words, an object may be empty or contain members. members are pairs. A pair is a string : value. A string is "" or " chars ".
That means empty strings are valid strings which are valid in a pair which is a valid member which is valid in objects.
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