We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
When specifying a pattern using a regular expression, one can not use the case insensitive flag in the regex.
Reproducible example (using dplyr):
library(dplyr) ' { "type": "object", "properties":{ "product_type": { "type": ["string"], "pattern": "^(?i)test$" } }, "required": [ "product_type" ], } ' %>% jsonvalidate::json_validator(engine = "ajv") -> validator
The text was updated successfully, but these errors were encountered:
Sorry for missing this issue for a year 😱
This appears to be an issue with the underling Ajv engine:
const Ajv = require('ajv'); const opts = {allErrors: true, verbose: true, unicodeRegExp: true, strict: true}; const obj = new Ajv(opts); const schema = { "type": "object", "properties":{ "product_type": { "type": ["string"], "pattern": "^(?i)test$" } }, "required": [ "product_type" ] } obj.compile(schema)
which errors with
Thrown: SyntaxError: Invalid regular expression: /^(?i)test$/: Invalid group
so the error reported is faithful to the underlying engine.
I found this issue on the Ajv repo: ajv-validator/ajv#101, though the link within to "defining custom keywords" is broken - I think this is the relevant page now: https://ajv.js.org/keywords.html
In short, this looks quite hard to support unfortunately
Sorry, something went wrong.
No branches or pull requests
Hi,
When specifying a pattern using a regular expression, one can not use the case insensitive flag in the regex.
Reproducible example (using dplyr):
The text was updated successfully, but these errors were encountered: