marshmallow-jsonschema
marshmallow-jsonschema copied to clipboard
Add support for marshmallow Regexp validator
Coverage decreased (-0.9%) to 99.083% when pulling 8fc9c3789ea58f2fa9d9cb3f6ee0574b4c555061 on obsoleter:master into 6f51771fc809a0762b3d98f4d246b70eb653d802 on fuhrysteve:master.
Coverage decreased (-0.9%) to 99.083% when pulling 8fc9c3789ea58f2fa9d9cb3f6ee0574b4c555061 on obsoleter:master into 6f51771fc809a0762b3d98f4d246b70eb653d802 on fuhrysteve:master.
Coverage decreased (-0.9%) to 99.083% when pulling 8fc9c3789ea58f2fa9d9cb3f6ee0574b4c555061 on obsoleter:master into 6f51771fc809a0762b3d98f4d246b70eb653d802 on fuhrysteve:master.
Hi,
thank you for maintaining marshmallow-jsonschema!
Are there any plans to accept this Pull request? Just came across the need to have that, started to write a handler and then saw this pull request...
Thanks for the bump, @dim0x69
I'm wondering if the regex syntax is the same between python and jsonschema? Does that matter here?
The regular expression syntax used is from JavaScript (ECMA 262, specifically). https://json-schema.org/understanding-json-schema/reference/regular_expressions.html
The python docs seem... unclear about whether they're using a specific / standard syntax?
For details of the theory and implementation of regular expressions, consult the Friedl book [Frie09], or almost any textbook about compiler construction. https://docs.python.org/3/library/re.html#regular-expression-syntax
Regular expressions (called REs, or regexes, or regex patterns) are essentially a tiny, highly specialized programming language embedded inside Python and made available through the re module. https://docs.python.org/3/howto/regex.html#introduction
I'm inclined to merge this as is with the hopes that most common use cases won't run into any meaningful discrepancies, however if you happen to have any insights on the above I'd love to hear
@fuhrysteve, I'm not sure how accuracte/comprehensive this page is, but it seems to indicate the Regular Expressions in Python have quite a few more features than those in JavaScript (the ECMAScript specification in particular). This would mean that there should be few issues with Python evaluating regular expressions defined in a JSON Schema since JSON Schema specifies the syntax/features of regex as defined in ECMAScript 262.
Ah so they're at least compatible to a reasonable extent. That makes sense. I created a pull request attempting to merge conflicts, but looks like there are some upstream changes that make the test fail. I can take a look later on!