Swashbuckle.AspNetCore
Swashbuckle.AspNetCore copied to clipboard
Regexp pattern not escaped in JSON
I have a property with the following attribute:
[RegularExpression("(?s)^[^\u0000-\u001f\\\\/*?<>|:\"]+$")]
Swashbuckle emits the following JSON:
"pattern": "(?s)^[^�-\\\\/*?<>|:\"]+$",
"type": "string"
Swagger-UI doesn't like this:

I tried NSwag as well, and it outputs:
"type": "string",
"minLength": 1,
"pattern": "(?s)^[^\u0000-\u001f\\\\/*?<>|:\"]+$"
...which Swagger-UI is happy with.
This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.
This issue was closed because it has been inactive for 14 days since being marked as stale.