Skip to content

GET request list parameters not handled correctly #217

@codemedian

Description

@codemedian

Hi,

I have an OpenAPI operation that looks as follows

 "/test/array": {
            "get": {
                "operationId": "ArrayTest",
                "parameters": [
                    {
                        "name": "value",
                        "in": "query",
                        "style": "form",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "explode": true
                    }
                ],
                "responses": {
                    
                }
            }
        },

In my understanding, this should support one or many string elements passed to it in the query, so both the below queries should be considered correct

  1. .../test/array?value=foo => ["foo"]
  2. .../test/array?value=foo&value=bar => ["foo", "bar"]

When running this however, the single element variant fails validation in the middleware which I think is a bug?

Thanks
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions