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

Example value for integer with minimum and maximum is out of bounds #5216

Closed
ilya-spv opened this issue Mar 4, 2019 · 3 comments
Closed

Comments

@ilya-spv
Copy link

ilya-spv commented Mar 4, 2019

Q&A (please complete the following information)

  • OS: Windows
  • Browser: Chrome
  • Version: 72
  • Method of installation: visual studio code extension (openapi-designer)
  • Swagger-UI version: [e.g. 3.21.0]
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

I use a visual studio extension to render things on the fly (openapi-designer) and have checked that it uses the latest version of swagger-ui

dueDay:
  type: integer
  minimum: 1
  maximum: 31

Describe the bug you're encountering

Generated example shows 0 though it cannot be accepted according to specifications

"dueDay": 0,

To reproduce...

Steps to reproduce the behavior:

  1. Render YAML with type: string and format: date
  2. Open an example value in the browser

Expected behavior

Expected to see a value between minimum and maximum

"dueDay": 15,

P.S. This probably is valid for other parameters like e.g. Multiples. It's possible that this is also a feature request and not a bug, I am not quite sure. There is of course an easy workaround to provide own example

@mmicu
Copy link

mmicu commented Oct 22, 2019

I need this feature. If you want, you can assign me this issue.

@webron
Copy link
Contributor

webron commented Oct 22, 2019

@mmicu thanks for offering to solve this issue. Please make sure to follow our Contribution Guide.

@hkosova
Copy link
Contributor

hkosova commented Dec 20, 2021

Support for minimum and maximum values in example generator was added in v. 3.45.0 (PR: #7043).

@hkosova hkosova closed this as completed Dec 20, 2021
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

5 participants