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

minimum should be a number greater than or equal to 0 #423

Closed
jradlica opened this issue Jan 19, 2024 · 2 comments
Closed

minimum should be a number greater than or equal to 0 #423

jradlica opened this issue Jan 19, 2024 · 2 comments

Comments

@jradlica
Copy link

jradlica commented Jan 19, 2024

Since version v0.8.0 we encounter error:

`minimum` should be a number greater than or equal to `0`

for the following field definition:

components:
  schemas:
    MyRequest:
      description: desc
      properties:
        numeric-value:
          type: number
          minimum: 0

The error suggests that minimum can be equal to 0, however error occurs for 0 value.

Spec which can be used for reproduction:

openapi: 3.0.1
info:
  title: API
  version: 1.0.0
  description: desc
paths:
  /endpoint:
    post:
      operationId: operationX
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MyRequest'
      responses:
        "200":
          description: Service is up and running.
          content:
            application/json:
              schema:
                type: string
              example:

components:
  schemas:
    MyRequest:
      description: desc
      properties:
        numeric-value:
          type: number
          minimum: 0
@daveshanley
Copy link
Owner

will provide a patch to fix this today.

daveshanley added a commit that referenced this issue Jan 20, 2024
An off my one issue, I used the wrong comparitor and then did not build the correct tests required that would have caight it. This has now been fixed.

Signed-off-by: quobix <dave@quobix.com>
daveshanley added a commit that referenced this issue Jan 20, 2024
An off my one issue, I used the wrong comparitor and then did not build the correct tests required that would have caight it. This has now been fixed.

Signed-off-by: quobix <dave@quobix.com>
@daveshanley
Copy link
Owner

This is fixed in v0.8.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