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

Support full scope of valid characters allowed in property names #10

Open
safris opened this issue Aug 9, 2023 · 0 comments
Open

Support full scope of valid characters allowed in property names #10

safris opened this issue Aug 9, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@safris
Copy link
Collaborator

safris commented Aug 9, 2023

RFC 8259 states there are no limits imposed on the value of strings used as JSON object names.

An object structure is represented as a pair of curly brackets surrounding zero or more name/value pairs (or members). A name is a string. A single colon comes after each name, separating the name from the value. A single comma separates a value from a following name. The names within an object SHOULD be unique.

object = begin-object [ member *( value-separator member ) ]
         end-object

member = string name-separator value

ECMA-262 explicitly states that all strings are valid object property names.

A property key value is either an ECMAScript String value or a Symbol value. All String and Symbol values, including the empty String, are valid as property keys. A property name is a property key that is a String value.

RFC 8259 lists the characters that must be escaped in JSON:

All Unicode characters may be placed within the quotation marks, except for the characters that MUST be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F).

ECMA-262 lists the characters that must be escaped in JavaScript:

A string literal is 0 or more Unicode code points enclosed in single or double quotes. […] All code points may appear literally in a string literal except for the closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN), and U+000A (LINE FEED).

@safris safris added the enhancement New feature or request label Aug 9, 2023
@safris safris added this to the v0.5 milestone Aug 9, 2023
@safris safris self-assigned this Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant