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

Possible pattern improvement in format pattern of the JSON schema? #116

Open
giacomomarchioro opened this issue Jun 11, 2021 · 0 comments
Open

Comments

@giacomomarchioro
Copy link
Contributor

Hello,
thanks again for this schema, extremely helpful, just wondering the following regex pattern:

"pattern": "^[a-z][a-z]*/.*$"

matches image/format and also image//format is this the expected behaviour?
If it is correct I would consider escaping the forward-slash as suggested here because this could cause an error when using the pattern with Javascript. The resulting pattern would be:

"pattern": "^[a-z][a-z]*\/.*$"

Otherwise, the following pattern does not match image//format but only image/format

^[a-z][a-z]*(?<!\/)\/(?!\/).*$

some tests here

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

No branches or pull requests

1 participant