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

[Feature] Support OpenAPI3 "style" parameters in SDK generators #3286

Open
ashb opened this issue Mar 28, 2024 · 0 comments
Open

[Feature] Support OpenAPI3 "style" parameters in SDK generators #3286

ashb opened this issue Mar 28, 2024 · 0 comments

Comments

@ashb
Copy link

ashb commented Mar 28, 2024

There is a feature of OpenAPI 3 that lets you change the style of how repeated parameters are specified https://spec.openapis.org/oas/v3.0.3#parameterStyle and https://spec.openapis.org/oas/v3.0.3#style-examples

The particular use case I have is to set explode=false to have CSV parameters rather than multiple query params.

Minimal OpenAPI spec file:

{
  "info": {
    "title": "My API",
    "version": "1.0.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/test/": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "explode": false,
            "name": "parameter",
            "required": true,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}

When called with multiple params this should result in ?parameter=a,b,c but it always/only produces ?parameter=a&parameter=b&parameter=c.

I've checked the python and Go SDK generators, and neither handle these style parameters, so I assume this is a universal feature request, though specifically I'm exploring Go, Python and Typescript generators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant