-
Notifications
You must be signed in to change notification settings - Fork 117
feat: Notify Invalid RegExp Patterns #261
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
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree company="Shadowscape, Inc." |
The JSON schema spec says that regexes must match the Regular Expression specification from JavaScript. https://json-schema.org/understanding-json-schema/reference/regular_expressions. So likely this is an issue with the The error should be shown on the schema document and not on the document that is being validated. Something like 'Unable to validate value. Pattern {0} provided by the schema is not supported.' |
Thanks @aeschli! |
This PR allows users to be notified when an invalid regex pattern is encountered.
This is useful if a JSON schema is published that contains patterns that are not supported by
new RegExp()
.For example, as of time of writing, the
version
pattern for thecomposer.json
schema includes a possessive quantifier (*+
) that is not supported by JavaScript (see composer.json schema definition).