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
For any api endpoints that do not use a request model, i.e query params, there is no way to view the regular expression pattern. Pattern is only displayed if there is a request model and you hover over a parameter on the Model Schema (which I must say I find a bit unintuitive tbh).
For example in my swagger json attached the path /api/address/search has a postcode parameter with the full pattern shown in the json, but api users have no way of knowing there is a required regex for the parameter.
My preference would be to simply display the 'pattern' in the description field after the description so the details can be viewed up front rather than hover over, but we could make do with introducing the same hover over the Parameter e.g request.postCode, or perhaps on hover over value input box itself would be best.
If anyone is aware of a way to customise the swagger ui to combine the Description and pattern fields (I'm using Swashbuckle 5.0 with an ASP.net web api) then please let me know.
The text was updated successfully, but these errors were encountered:
Also would like this feature - hover or option to display pattern next to description
Would be nice if the swagger UI validated the input against the pattern as well
swagger.txt
For any api endpoints that do not use a request model, i.e query params, there is no way to view the regular expression pattern. Pattern is only displayed if there is a request model and you hover over a parameter on the Model Schema (which I must say I find a bit unintuitive tbh).
For example in my swagger json attached the path /api/address/search has a postcode parameter with the full pattern shown in the json, but api users have no way of knowing there is a required regex for the parameter.
My preference would be to simply display the 'pattern' in the description field after the description so the details can be viewed up front rather than hover over, but we could make do with introducing the same hover over the Parameter e.g request.postCode, or perhaps on hover over value input box itself would be best.
If anyone is aware of a way to customise the swagger ui to combine the Description and pattern fields (I'm using Swashbuckle 5.0 with an ASP.net web api) then please let me know.
The text was updated successfully, but these errors were encountered: