Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request parameters 'pattern' is not displayed if parameter type is query #2103

Closed
heresandyboy opened this issue Apr 19, 2016 · 5 comments
Closed

Comments

@heresandyboy
Copy link

heresandyboy commented Apr 19, 2016

  • swagger-ui version 2.1.4
  • a swagger file reproducing the issue
    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.

image

image

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.

@paulwilton
Copy link

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

@ljwagerfield
Copy link

Issue is present for in: header parameters too. Would be useful to support this in the UI to assist with JWT tokens, etc.

@webron
Copy link
Contributor

webron commented Jun 9, 2017

See #993.

@webron webron closed this as completed Jun 9, 2017
@githoober
Copy link

I still cannot find where it's fixed.

@webron
Copy link
Contributor

webron commented Jun 15, 2017

It wasn't fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants