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

Zero and negative numbers aren't recognized as float #367

Closed
gsimon75 opened this issue Sep 12, 2020 · 1 comment
Closed

Zero and negative numbers aren't recognized as float #367

gsimon75 opened this issue Sep 12, 2020 · 1 comment
Assignees

Comments

@gsimon75
Copy link

Describe the bug
Zero and negative numbers aren't recognized as float, due to this

To Reproduce
Define a parameter for an operation to be type=number, format=float, minimum=-10, then try to call that operation with the param value of 0, 0.0, or -1.1

Actual behavior
[{"path":".body.amount","message":"should match format "float"","errorCode":"format.openapi.validation"}]

Expected behavior
Accept zero and negative numbers as well.

Examples and context
An example or relevant context e.g. an OpenAPI snippet, an Express handler function snippet

requestBody:
  required: true
    content:
      application/json:
        schema:
          type: number
          format: float
          minimum: -10.0
cdimascio added a commit that referenced this issue Sep 14, 2020
@cdimascio cdimascio self-assigned this Sep 14, 2020
cdimascio added a commit that referenced this issue Sep 14, 2020
(fix) #367 - handle negative floats
@cdimascio
Copy link
Owner

cdimascio commented Sep 14, 2020

@gsimon75 thanks for the issue. this is now fixed in v3.17.1

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

2 participants