Skip to content

Idea: Consider relaxing dict key charset restriction, rely on "name" instead of "altnames.json" #3

@Fannon

Description

@Fannon

Just a suggestion / feedback on something that could be done differently, but the current proposal also works.

Instead of applying the restricted charset (Identifier Rules) to the dictionary keys AND to the name, we could make it more similar to how JSON Schema works today:

  • There are no limitation on dictionary key charset and it represents the JSON encoding name (altnames.json). If this contains restricted chars, it's mandatory to add name for codegen / tools.
  • The altnames.json can be removed, and it's not necessary to use a spec extension just to describe existing JSON / JS structures as they are.
  • Tools / codegens will always use name and fall back to the dictionary key.

Advantages from my view:

  • Closer to how JSON Schema works today
  • One less concept and one less spec extension to understand
  • I think that modeling existing JSON structures is very common, the new identifier name restrictions may only work consistently for greenfield / new models that are created in JSON Structure from start.

Disadvantages:

  • Validation of correct JSON Structure document is more complicated, because the regexp validation on dictionary keys is conditional (only has to match regex if no name is provided).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions