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

exclusiveMin shows [0...0] #1761

Closed
takumi-ricoh opened this issue Oct 1, 2021 · 2 comments · Fixed by #1799
Closed

exclusiveMin shows [0...0] #1761

takumi-ricoh opened this issue Oct 1, 2021 · 2 comments · Fixed by #1799
Assignees

Comments

@takumi-ricoh
Copy link

takumi-ricoh commented Oct 1, 2021

Describe the bug
Display is strange when exclusive minimum is set

Expected behavior
shows >0

Screenshots
schema
image

result
image

Additional context
OpenAPI v3.1
redoc-cli 0.12.3

@miqh
Copy link
Contributor

miqh commented Oct 7, 2021

This isn't a bug with Redoc.

exclusiveMinimum is should be assigned a boolean value—not a numeric one. You should use it in conjunction with the minimum keyword to achieve what you want (i.e. > 0).

https://swagger.io/docs/specification/data-models/data-types/#range

@ivana-isadora
Copy link
Contributor

exclusiveMinimum is should be assigned a boolean value—not a numeric one. You should use it in conjunction with the minimum keyword to achieve what you want (i.e. > 0).

Note that this has changed in OpenAPI 3.1.

Quoting from https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

Tweak exclusiveMinimum and exclusiveMaximum

These two keywords used to take a boolean value, 
which would modify the meaning of the `minimum` and `maximum` properties. 
In OpenAPI v3.1 they are distinct values.

# OpenAPI v3.0
minimum: 7
exclusiveMinimum: true
# OpenAPI v3.1
exclusiveMinimum: 7

The person who reported the issue is using OpenAPI 3.1, so the numeric value should work.

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

Successfully merging a pull request may close this issue.

5 participants