Skip to content

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

Merged
merged 3 commits into from
Sep 23, 2017

Conversation

handrews
Copy link
Contributor

@handrews handrews commented Sep 8, 2017

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.

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.
@handrews handrews added this to the draft-07 (wright-*-02) milestone Sep 8, 2017
</t>
<t>
A regular expression, which SHOULD be valid according to the
<xref target="ecma262">ECMA 262</xref> regular expression dialect.
Copy link
Member

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

Copy link
Contributor Author

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks- fixed!

@handrews
Copy link
Contributor Author

@Julian are you willing to sign off on this after the update I made from your previous comment?

@handrews
Copy link
Contributor Author

Anyone want to sign off on this? @epoberezkin? @awwright? @Relequestual? @dlax?

@Julian
Copy link
Member

Julian commented Sep 23, 2017

Lgtm!

@handrews handrews merged commit 0282f4a into json-schema-org:master Sep 23, 2017
@handrews handrews deleted the regex branch September 23, 2017 05:21
@gregsdennis gregsdennis added clarification Items that need to be clarified in the specification and removed Type: Bug labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants