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

Only the first missing required field is returned in error message #1037

Open
briangweber opened this issue Jan 2, 2025 · 0 comments
Open

Comments

@briangweber
Copy link

Describe the bug
If multiple required fields are omitted from the request body, only the first is reported missing in the error message.

To Reproduce
Make an empty object PUT request to /pet with this defintion

paths:
  /pet:
    put:
      tags:
        - pet
      summary: Update an existing pet
      description: Update an existing pet by Id
      operationId: updatePet
      requestBody:
        description: Update an existent pet in the store
        content:
          application/json:
            schema:
              required:
                - name
                - color
              type: object
              properties:
                name:
                  type: string
                  example: doggie
                color:
                  type: string
                  example: brown

Actual behavior
Error: must have required property 'name'

Expected behavior
Errors: must have required property 'name' and must have required property 'color'

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

1 participant