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

Swagger UI - can it display Minimum value, Maximum value, Pattern, Default Values ?? #1217

Closed
aviadavi opened this issue Apr 28, 2015 · 14 comments
Milestone

Comments

@aviadavi
Copy link

I would expect API documentation to include those "Validation rules"

@webron
Copy link
Contributor

webron commented Apr 28, 2015

It displays those when you hover over the property in the Model.

@aviadavi
Copy link
Author

OK. I see it. (for Range and Pattern, but not for default values)
Any chance to put this information in the model without hovering over the property ?
I want to be able to generate documentation that does not require hovering over a properties.

I don't want my clients to guess on what property to hover.

@webron
Copy link
Contributor

webron commented Apr 28, 2015

If you can come up with a way to display all the information in a way that's visually appealing and won't make the UI bloated, feel free to create a PR with the implementation.

@fehguy
Copy link
Contributor

fehguy commented Apr 28, 2015

Or even a mock up of how it could be more effective would be great.

@aviadavi
Copy link
Author

In RAML 0.8 display looks appealing.

see example here: https://anypoint.mulesoft.com/apiplatform/popular/#/portals/apis/6308/versions/6302/pages/31760

It looks like there is enough space for everything in that display. doesn't it?

@webron webron added this to the future milestone May 4, 2015
@webron webron modified the milestones: v2.1.2, future Jul 21, 2015
@webron webron modified the milestones: v2.1.2, v2.1.3 Jul 31, 2015
@webron webron modified the milestones: v2.1.3, v2.1.4 Sep 2, 2015
@DerManoMann
Copy link

What about pattern for a parameter value?

@DerManoMann
Copy link

To clarify my question - I do have pattern configured for url parameter and wonder if there is any code to support validation for those.

@tanob
Copy link

tanob commented Sep 22, 2016

@webron the feature of displaying information about the range doesn't seem to be working. If you look at http://petstore.swagger.io/, the orderId has a maximum and minimum specified, if you hover orderId in the Model tab it doesn't show.

@webron
Copy link
Contributor

webron commented Sep 22, 2016

@tanob right now, these are displayed for model properties only, and not primitive parameters.

@michaelbaqadi
Copy link

michaelbaqadi commented May 23, 2017

@webron do you guys now support having maximum and minimum with query parameters such as limit and offset?

@webron
Copy link
Contributor

webron commented May 23, 2017

@michaelbaqadi support in what sense?

@michaelbaqadi
Copy link

michaelbaqadi commented May 24, 2017

For example, we can specify the maximum integer number for the limit parameter in url.
So if I want to display the maximum number allowed for the limit parm which is 1000 in the bellow example.

  • name: limit
    in: query
    description: number of pets to return
    type: integer
    minimum: 10
    maximum: 1000

@webron
Copy link
Contributor

webron commented Jun 5, 2017

@michaelbaqadi - sorry for the late reply, somehow missed the notification on it.

I'm honestly not sure if we support those right now. The best way to find out is to simply test it.

@webron
Copy link
Contributor

webron commented Jun 9, 2017

Closing in favor of #993.

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

No branches or pull requests

6 participants