Open DavidBiesack opened 1 year ago
We've already had a discussion around that here https://github.com/stoplightio/spectral/issues/2030.
Since a bug fix intentionally disables Unicode, and enabling it may break others, I would like an option to enable it, either in the CLI options or in the spectral ruleset.
That's fine by me. I'm not sure how the option would be named though. It's really specific to schema validation fn.
Thanks @P0lip . Do you know why #2030 was closed? I don't see this as having been resolved.
One option may be to define two schema validation functions, so one could disable one rule (that uses the current function) and enable a different rule that uses the unicode RegExp rule. I don't know exactly how example validation is done (i.e. if it is deep inside the schema validation rule, or if it is separate.
Do you know why https://github.com/stoplightio/spectral/issues/2030 was closed? I don't see this as having been resolved.
I don't know, to be frank.
I'll keep this one up
Describe the bug
spectral incorrectly flags an example corresponding to a valid regexp pattern as invalid.
JSON Schema says that patterns should be processed as Unicode regexp, but it appears that the fix #1787 for #1782 turned off
unicodeRegExp
:Thus for the following property
We get
even though this is a valid example that matches the regex
To Reproduce
Save the sample as
openapi.yaml
Run this CLI command
See error
Expected behavior
no false negative error for a valid pattern that matches a pattern with a charset pattern
Since a bug fix intentionally disables Unicode, and enabling it may break others, I would like an option to enable it, either in the CLI options or in the spectral ruleset.
Environment (remove any that are not applicable):