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
I have a generated regular expression from PHP code and because it uses preg_quote() the final regular expression escapes the '#' even though it is not required
The regular expression that is generated in my JSON schema is:
The pattern validation in class Pattern adds the # delimiter around it and replaces '#' with '\#' for the call to preg_match. Resulting in this preg_match pattern:
Basically only # should be escaped in class Pattern if # is not already escaped. I could fix it for myself by unescaping it in the OpenAPI spec, but maybe it is a good idea to fix this in the validator as preg_quote() always escapes '#' even if you do not provide it as a delimiter
The text was updated successfully, but these errors were encountered:
I have a generated regular expression from PHP code and because it uses preg_quote() the final regular expression escapes the '#' even though it is not required
The regular expression that is generated in my JSON schema is:
The pattern validation in class Pattern adds the # delimiter around it and replaces
'#'
with'\#'
for the call to preg_match. Resulting in this preg_match pattern:This results in an error in the openapi psr7 validator:
"preg_match(): Unknown modifier '\'"
Basically only # should be escaped in class Pattern if # is not already escaped. I could fix it for myself by unescaping it in the OpenAPI spec, but maybe it is a good idea to fix this in the validator as preg_quote() always escapes '#' even if you do not provide it as a delimiter
The text was updated successfully, but these errors were encountered: