json5 / json5-spec

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

Proposal: Numeric literals in object keys #31

Closed AldoMX closed 3 years ago

AldoMX commented 3 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 3 years ago

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