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

Support exploded query string arrays #593

Open
ntotten opened this issue Jan 24, 2025 · 0 comments
Open

Support exploded query string arrays #593

ntotten opened this issue Jan 24, 2025 · 0 comments
Labels
feature New feature or request

Comments

@ntotten
Copy link
Member

ntotten commented Jan 24, 2025

We should support exploded format of query strings in both the docs and the playground.

openapi: 3.0.0
info:
  title: Comma-Separated Query Parameters Example
  version: 1.0.0
paths:
  /example:
    get:
      summary: Example endpoint
      parameters:
        - name: items
          in: query
          description: Comma-separated list of items
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Success
  • style: form: Indicates that the query parameter is serialized as form data.
  • explode: false: Specifies that the array values should be serialized as a single comma-separated string (e.g., items=one,two,three).
  • schema with type: array: Defines that the parameter is an array, with items specifying the type of each value (in this case, string).

For a request to this API, the query string would look like:

GET /example?items=one,two,three

The server will parse items as an array: ['one', 'two', 'three'].

@ntotten ntotten added customer feature New feature or request labels Jan 24, 2025
@mosch mosch removed the customer label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

No branches or pull requests

2 participants