json5 / json5-spec

The JSON5 Data Interchange Format
https://spec.json5.org
MIT License
50 stars 10 forks source link

Proposal: Numeric literals in object keys #31

Closed AldoMX closed 4 years ago

AldoMX commented 4 years ago

With the current spec, the following JSON is invalid because the keys are not a valid identifier name:

{
  employeesById: {
    1: { name: "Huey", age: 30 },
    2: { name: "Dewey", age: 29 },
    3: { name: "Louie", age: 31 }
  }
}

This ticket is to propose allowing numeric literals alongside identifier names for object keys.

jordanbtucker commented 4 years ago

Thank you for this proposal. It is a duplicate of #10. Please see the comments there.