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
With the new version 1.0.82 we got errors validating our openapi 3.0 documents. The reason is, that we use properties which a allowed by a patternproperties rule in the openapi spec:
"patternProperties": {
"^x-": {
}
Our properties (e.g. x-api-id) are conform with the spec. But the new JDKRegularExpression class fails to validate our property.
The reason is that JDKRegularExpression uses Matcher.matches() to validate the input. This method returns true only if the whole string matches - the regex is treated by matches() Method as 'anchored regex'.
The json schema spec states:
A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.
I suggest to change JDKRegularExpression to:
@Override
public boolean matches(String value) {
return this.pattern.matcher(value).find();
}
The text was updated successfully, but these errors were encountered:
* Resolves improper anchoring of patternProperties
Fixes#782
* Resolves improper anchoring of regular expressions in both Joni and JDK engines.
Resolves#495 and #782
---------
Co-authored-by: Faron Dutton <[email protected]>
With the new version 1.0.82 we got errors validating our openapi 3.0 documents. The reason is, that we use properties which a allowed by a patternproperties rule in the openapi spec:
Our properties (e.g.
x-api-id
) are conform with the spec. But the newJDKRegularExpression
class fails to validate our property.The reason is that
JDKRegularExpression
usesMatcher.matches()
to validate the input. This method returns true only if the whole string matches - the regex is treated bymatches()
Method as 'anchored regex'.The json schema spec states:
I suggest to change
JDKRegularExpression
to:The text was updated successfully, but these errors were encountered: