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

Prohibit certain strings from being used as type names or schema IDs #57

Closed
popematt opened this issue Dec 15, 2021 · 1 comment
Closed

Comments

@popematt
Copy link
Contributor

Ion Schema 1.0 does not place any restrictions on the strings used for schema IDs or type names.

Most programming languages do have restrictions on the strings that you can use for identifiers, so such restrictions are not unreasonable in general. The purpose of such restrictions is to avoid ambiguous cases when tokenizing or otherwise processing code in that language. A secondary purpose is to stop people from doing things that are generally a bad idea. The Ion library(s) already take care of tokenizing and loading the schemas documents into the Ion DOM, but it would make the Ion Schema implementation easier (particularly the violation messaging) if certain classes of strings were prohibited.

We may want to prohibit the following types of strings from being used as type names or schema IDs:

  • The empty string
  • Strings with leading or trailing whitespace
  • Strings that contain newlines
  • Strings that contain non-printable characters
@popematt popematt added the requires new version Something that should be considered for next version of the Ion Schema Specification label Dec 15, 2021
@popematt popematt removed the requires new version Something that should be considered for next version of the Ion Schema Specification label Jul 22, 2022
@popematt
Copy link
Contributor Author

Closing in favor of #60, since this would be better off as a linter rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant