-
-
Notifications
You must be signed in to change notification settings - Fork 315
Restore "regex" to the list of formats. #398
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
Conversation
Addresses json-schema-org#392. It's come up several times that removing this format did not make sense and was quite possibly an accident. The "regex" format was actually still in use in the meta-schema for "pattern". I've added it to "patternProperties" as well using "propertyNames". Regular expressions are a fundamental programming tool, and play a part in JSON Schema's specification. It seems incorrect to not offer semantic documentation / optional validation of them.
</t> | ||
<t> | ||
A regular expression, which SHOULD be valid according to the | ||
<xref target="ecma262">ECMA 262</xref> regular expression dialect. |
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 don't recall off hand, but I suspect strongly that the original spec made the same mention here that implementations may not be using ECMA regexes (and that this format might actually mean "some regex dialect, so restrict yourself to the common subsets).
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.
Thanks @Julian, I'd forgotten about that section. I've updated it and made the regex definition reference it.
Interoperability considerations for regular expressions have their own section. This change updates that section to make a note of the "regex" value for "format" as well as the keywords that use regular expressions. It also makes reference to that section within the "regex" format definition to establish minimum support.
jsonschema-validation.xml
Outdated
<t> | ||
Implementations that validate formats MUST accept at least the subset of | ||
ECMA 262 defined in the <xref target="regexInterop">Regular Expressions</xref> | ||
section of this specification, and SHOULD accept all validECMA 262 expressions. |
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.
@handrews there's a missing space between valid and ECMA
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.
Thanks- fixed!
@Julian are you willing to sign off on this after the update I made from your previous comment? |
Anyone want to sign off on this? @epoberezkin? @awwright? @Relequestual? @dlax? |
Lgtm! |
Addresses #392. It's come up several times that removing
this format did not make sense and was quite possibly an accident.
The "regex" format was actually still in use in the meta-schema
for "pattern". I've added it to "patternProperties" as well
using "propertyNames".
Regular expressions are a fundamental programming tool, and
play a part in JSON Schema's specification. It seems incorrect
to not offer semantic documentation / optional validation of them.