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

Add support for marshmallow Regexp validator #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcaxmacher
Copy link

No description provided.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 99.083% when pulling 8fc9c37 on obsoleter:master into 6f51771 on fuhrysteve:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 99.083% when pulling 8fc9c37 on obsoleter:master into 6f51771 on fuhrysteve:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 99.083% when pulling 8fc9c37 on obsoleter:master into 6f51771 on fuhrysteve:master.

@dim0x69
Copy link

dim0x69 commented Jul 10, 2019

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...

@fuhrysteve
Copy link
Owner

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

@jcaxmacher
Copy link
Author

jcaxmacher commented Jul 10, 2019

@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.

@fuhrysteve fuhrysteve mentioned this pull request Jul 10, 2019
@fuhrysteve
Copy link
Owner

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!

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.

4 participants