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

compile strings etc as regexes #101

Merged
merged 12 commits into from
Jan 5, 2025
Merged

compile strings etc as regexes #101

merged 12 commits into from
Jan 5, 2025

Conversation

mmoskal
Copy link
Collaborator

@mmoskal mmoskal commented Jan 2, 2025

cc @hudson-ai for awareness; still WIP!

@mmoskal mmoskal marked this pull request as ready for review January 3, 2025 12:49
@mmoskal mmoskal requested a review from hudson-ai January 3, 2025 12:49
@mmoskal
Copy link
Collaborator Author

mmoskal commented Jan 3, 2025

I think this is good to go. It happens. to fix an enum quoting issue that's present on main (see added testcase)

@hudson-ai
Copy link
Collaborator

I think this is good to go. It happens. to fix an enum quoting issue that's present on main (see added testcase)

Awesome, will try to review today!

Comment on lines 525 to 530
// TODO: is this special case needed?
Schema::Number {
minimum: Some(x),
maximum: Some(y),
..
} if x == y => Some(RegexAst::Literal(x.to_string())),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this special case actually get us into trouble, e.g. if min == max, but exclusiveMinimum > minimum, or if min == max is a non-integer, but we have integer=True?

Btw I'm open to changing our representation to exclusive{Minumum,Maximum} being bools if it simplifies things.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's nuke it then

@hudson-ai
Copy link
Collaborator

Bar my one comment, lgtm!

@mmoskal mmoskal merged commit 9c795ea into main Jan 5, 2025
1 check passed
@mmoskal mmoskal deleted the json_regex branch January 5, 2025 22:57
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

Successfully merging this pull request may close these issues.

2 participants