You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Regex validator will convert any given Python regex to ECMA regex when creating a schema.
While this behavior is indeed the expected one according to the json-schema specification, it can sometimes cause a problem: many libraries, even those recommended by json-shcema, DO NOT support the ECMA regex notation thus failing to validate properly.
It would be very helpful to be able to generate schema that is not ECMA 262.
Of course, the default behavior should stay as is, because it is correct, and in order to keep backward compatibility.
The requested behavior can be legitimized by the fact that the json-schema clearly states:
... These regular expressions SHOULD be valid according to the ECMA 262 [ecma262] regular expression dialect.
And RFC2119, which json-schema conforms to, states that:
SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.
So, it is actually OK to support other notations as well.
The text was updated successfully, but these errors were encountered:
Currently the
Regex
validator will convert any given Python regex to ECMA regex when creating a schema.While this behavior is indeed the expected one according to the
json-schema
specification, it can sometimes cause a problem: many libraries, even those recommended byjson-shcema
, DO NOT support the ECMA regex notation thus failing to validate properly.It would be very helpful to be able to generate schema that is not ECMA 262.
Of course, the default behavior should stay as is, because it is correct, and in order to keep backward compatibility.
The requested behavior can be legitimized by the fact that the
json-schema
clearly states:And
RFC2119
, whichjson-schema
conforms to, states that:So, it is actually OK to support other notations as well.
The text was updated successfully, but these errors were encountered: