Skip to content

Commit 55169ab

Browse files
committed
Expand list of disallowed characters in names with stated reasons
1 parent 83a3b42 commit 55169ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

specification/parts/core.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ The name uniqueness requirement exists for all items within a file, but does not
5353

5454
Names in G4MF may be thought of as serving the same purpose as `"id"` values in other formats. They serve as unique identifiers for items within a file, allowing for external systems to unambiguously refer to specific items by name. However, this property is named `"name"` rather than `"id"` to avoid confusion with other schemes, such as numeric IDs, numeric indices, UUIDs, URIs, or other ways to specify identifiers. The `"name"` property is intended to be a human-readable and meaningful unique identifier, meant for display in user interfaces, referencing externally, and conveying semantic meaning about the item it names, such as G4MF nodes named after bones in a character skeleton rig (see [G4MF Characters/Avatars](mesh/character_avatar.md)). Note that within a G4MF file, items are referred to by index in a specification-defined array (see [IDs](#ids)), ensuring that internal references are compact, efficient, and always refer to the correct data type. For example, this design makes it impossible for a mesh's `"material"` property to refer to a node, mesh, texture, or any other non-material item. However, indices are likely to change across file edits; therefore, unique names provide a way for external references to refer to items in a more stable way.
5555

56-
All names in a G4MF file MUST NOT contain the following characters: `"`, `.`, `:`, `@`, `/`, and literal `\`. The `\` character may be used for escaping characters, but names MUST NOT contain literal backslashes, so `\\` MUST NOT appear in the serialized version of the name in a G4MF file. Furthermore, names MUST NOT contain any control characters, even escaped control characters, including both ASCII control characters and the extended Unicode control characters, as is already required for the entire G4MF JSON structure, except that names additionally MUST NOT contain newline or tab characters. Names are RECOMMENDED to not contain spaces and not contain other punctuation characters that can be interpreted as special characters in certain contexts, however, all other characters not explicitly forbidden are allowed.
56+
All names in a G4MF file MUST NOT contain the following characters: `"`, `.`, `:`, `@`, `{`, `}`, `[`, `]`, `/`, and literal `\`. The `\` character is reserved as the JSON escape character and may be used for escaping characters, but names MUST NOT contain literal backslashes as a standalone character in the decoded string. The characters `{}[]/` are reserved for use in JSON pointer paths, and the characters `".:@` are reserved for use in runtime-determined path syntaxes and selectors across many programming languages and contexts, so these characters are forbidden in names to avoid ambiguity and potential parsing issues when names are used in these contexts.
57+
58+
Furthermore, names MUST NOT contain any control characters, even escaped control characters, including both ASCII control characters and the extended Unicode control characters, as is already required for the entire G4MF JSON structure, except that while the G4MF JSON allows newline and tab characters, names additionally MUST NOT contain newline or tab characters. Names are RECOMMENDED to not contain spaces and not contain other punctuation characters that can be interpreted as special characters in certain contexts, however, all other characters not explicitly forbidden are allowed.
5759

5860
## File References
5961

0 commit comments

Comments
 (0)