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
Following this I have defined my own RegexCompiler to try and log the errors and got the following error: error parsing regexp: invalid or unsupported Perl syntax: '(?!'
The text was updated successfully, but these errors were encountered:
efimovalex
changed the title
Invalid regex pattern fails silently on openapi3filter ValidateResponse/ValidateRequest
Invalid regex pattern fails silently on openapi3filter ValidateResponse/ValidateRequest then panics
Dec 12, 2024
I have the following field
and I get the following panic when validating it against an empty string
Following this I have defined my own RegexCompiler to try and log the errors and got the following error:
error parsing regexp: invalid or unsupported Perl syntax: '(?!'
The main issue is here https://github.com/getkin/kin-openapi/blob/v0.128.0/openapi3/schema.go#L1736-L1741 as we do not return an error in the case of multiple error option being true, and then we just try to validate with a nil value for the RegexMatcher.
Another issue identified was that the ValidateResponse does not take the custom regexCompiler setting: https://github.com/getkin/kin-openapi/blob/v0.128.0/openapi3filter/validate_response.go#L66-L77, so I cannot implement a workaround for this.
The text was updated successfully, but these errors were encountered: