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

Explicitly disable format assertions #31

Open
michaelmior opened this issue Jan 16, 2025 · 2 comments
Open

Explicitly disable format assertions #31

michaelmior opened this issue Jan 16, 2025 · 2 comments

Comments

@michaelmior
Copy link

There doesn't seem to be a way to explicitly disable format assertions. I am using a draft-07 schema and I would like to have format assertions disabled but there doesn't seem to be a method to do so.

@santhosh-tekuri
Copy link
Owner

as per draft-07, they cannot be disabled. but you can achieve this with following hack

you can override the default format implementations using compiler.registerFormat method which does nothing.
you can see list of default formats supported in https://github.com/santhosh-tekuri/boon/blob/main/src/formats.rs#L24

note that still you can't override regex format

@michaelmior
Copy link
Author

michaelmior commented Jan 27, 2025

draft-07 indicates that format does not need to be implemented as an assertion. It's up to the implementation. That said, boon implementing them as assertions is valid according to the spec, but it would be helpful to have the ability to make this behavior optional.

The "format", "contentType", and "contentEncoding" keywords can also be implemented as assertions, although that functionality is an optional part of this specification, and the keywords convey additional non-assertion information.

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

2 participants