-
-
Notifications
You must be signed in to change notification settings - Fork 91
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 look-around patterns using fancy-regex #220
Add support for look-around patterns using fancy-regex #220
Conversation
Codecov Report
@@ Coverage Diff @@
## master #220 +/- ##
==========================================
- Coverage 82.70% 82.65% -0.05%
==========================================
Files 53 53
Lines 3590 3615 +25
==========================================
+ Hits 2969 2988 +19
- Misses 621 627 +6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the direction and it looks good to me :)
I think that it is important to add a new variant to the ValidationErrorKind
enum that will indicate the backtracking issue and use it in PatternValidator::validate
and other cases when patterns are used (additionalProperties
)
Maybe one extra thing - it will be nice to have a test case for |
@Stranger6667 How would you like me to handle the commits to address these comments. Should I squash them with the existing commit? |
In the end, I plan to squash them into one, so feel free to push more :) |
I think I addressed all of the suggestions above via the new commits. I also added matching and non-matching test cases to I had a thought that it would be good to add an integration test for the combination of |
Looks great to me! :) Thank you for contributing. I appreciate it :) I'll check it one more time tomorrow and probably will release these changes in the new release :) |
I'm not sure what to make of that |
No problem, thanks for bearing with me on this. It's my first contribution to a Rust project and it's been really educational to see how this project is set up. |
Hm, maybe it is connected to the recent Rust toolchain update 🤷 I'll apply a fix after merge :)
|
I am glad to hear that! :) |
Uses
fancy-regex
in place ofregex
for matching against all patterns in JSON schemas.regex
is still used when converting a RegEx for ECMA 262 to take advantage of theRegex::replace_all
method, which is not included infancy-regex
. Sincefancy-regex
depends onregex
anyway, this does not affect the final size of the compiled binary (thanks to this commit for the idea).I also removed the test from #214, since that pattern is supported in this PR.