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

Support for pattern and format #23

Open
untitaker opened this issue May 9, 2023 · 2 comments
Open

Support for pattern and format #23

untitaker opened this issue May 9, 2023 · 2 comments
Labels
help wanted Extra attention is needed jsonschema-feature Missing fundamental support for a particular JSON schema feature

Comments

@untitaker
Copy link
Member

Addition of pattern or format should be a breaking change. Removal should not be.

Changing format to a different value should also be a breaking change. Not out of principle, but I think it is somewhat unlikely that one format is a subset of another. So this seems like the easiest thing to do.

But what about changing the value of pattern? We'd have to figure out whether the set of strings accepted by one regex is a subset of the strings accepted by another regex. Maybe the rust regex crate exposes the AST for that, but regexes in jsonschema are ECMAscript regexes. Maybe the saner way to go about this is to detect breaking changes using fuzzing or property testing.

An exciting research topic for sure.

@untitaker untitaker added jsonschema-feature Missing fundamental support for a particular JSON schema feature help wanted Extra attention is needed labels May 9, 2023
@6293
Copy link
Contributor

6293 commented May 19, 2023

This is an unrealistic edge case but if both lhs and rhs are sets of regexes within anyOf, fuzzing will run n * m times to find the most similar pairs of regexes. Nice if we can avoid this

@6293
Copy link
Contributor

6293 commented May 19, 2023

e.g. just respect the ordering and skip hungarian in such cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed jsonschema-feature Missing fundamental support for a particular JSON schema feature
Projects
None yet
Development

No branches or pull requests

2 participants