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

Add support for customizing violations messages #105

Open
popematt opened this issue Dec 30, 2022 · 0 comments
Open

Add support for customizing violations messages #105

popematt opened this issue Dec 30, 2022 · 0 comments
Labels
enhancement New feature or enhancement for the Ion Schema _specification_

Comments

@popematt
Copy link
Contributor

Why?

  • Sometimes the Ion Schema violations messages can be verbose. They are technically correct, but they may be information that doesn't convey meaning to a human.
  • Prevent leaking implementation details in the violations message.

Possible Solutions

  1. Allow a type to be marked to indicate that violation messages from the constraints of that type should be suppressed. If a value fails to match that type, the violations include only "value does not match type ".
  2. Allow a type to have a custom message when a value fails to match the type. This could replace or augment the standard messages from the Ion Schema library.
  3. Combine 1 and 2 in some way.

Why not to do this?

  • The violations messages are not part of the Ion Schema specification in Ion Schema 1.0 or 2.0. Adding support for customizing the violations messages may imply that the violations messages should be part of the specification. This could be mitigated by making it an optional feature—not all implementations are required to have it, but those that do have the feature must do it in a consistent way.
  • The problem statement is nebulous and vague right now. We need a more compelling customer use case to take this idea any further.

Dear Reader, if you have a use case for a feature like this, please comment on this issue and let us know.

@popematt popematt added the enhancement New feature or enhancement for the Ion Schema _specification_ label Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement for the Ion Schema _specification_
Projects
None yet
Development

No branches or pull requests

1 participant