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

Query with example turns field into required #6998

Closed
massada opened this issue Feb 25, 2021 · 0 comments · Fixed by #7003
Closed

Query with example turns field into required #6998

massada opened this issue Feb 25, 2021 · 0 comments · Fixed by #7003

Comments

@massada
Copy link

massada commented Feb 25, 2021

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome, safari
  • Version: chrome 88.0.4324.192, safari 14.0.3 (16610.4.3.1.4)
  • Method of installation: Swashbuckle.AspNetCore
  • Swagger-UI version: 3.42.0
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.1
info:
  title: example
  version: v1
paths:
  /example:
    get:
      parameters:
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            format: int32
          example: 1
      responses:
        '200':
          description: OK

Describe the bug you're encountering

When a query param has the example set, if we try to remove the value to send an empty query string, validation fails like the field is required.

To reproduce...

Steps to reproduce the behavior:

  1. Go to query filed
  2. Remove the value
  3. Click Execute
  4. See error

Expected behavior

When example is set the query field must not be required.

Screenshots

Screenshot 2021-02-25 at 01 16 42

Screenshot 2021-02-25 at 01 18 21

Screenshot 2021-02-25 at 01 16 26

Additional context or thoughts

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.

2 participants