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

Default Parameter Value Not Prefilled in “Send API Request” Block #1079

Open
oleksandr-hyriavets opened this issue Feb 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@oleksandr-hyriavets
Copy link

Describe the bug

When using the “Send API Request” block, the default value of a parameter (if defined in the OpenAPI schema) is not prefilled in the input field. This forces users to manually enter the value, even when a default is explicitly set.

Expected behavior

If a parameter has a defined default value in the OpenAPI schema, the input field should automatically be prefilled with that value. For enum parameters, the default option should be preselected.

Possible solution

Respect the default value and prefill proper input or select in case of enum with that value

Steps to reproduce

  1. Define an OpenAPI schema with a parameter that includes a default value:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: Add a new pet to the store
      operationId: addPet
      parameters:
       - in: query
         name: limit
         required: true
         schema:
          type: number
          default: 10
  1. Generate the API documentation page.
  2. Check the input field for the limit query parameter in the “Send API Request” block.

Screenshots

Image

Context

It is annoying to force a user to choose the right value for the parameter, especially in cases when there is one possible value for the parameter, but the parameter is required

Your Environment

Irrelevant to the environment

@oleksandr-hyriavets oleksandr-hyriavets added the bug Something isn't working label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant