Skip to content

Duplicate identifier for parameters with the same name but different location/in #464

Open
@jesperkristensen

Description

@jesperkristensen

I am using an OpenAPI v3 spec generated by NSwag where the Parameters Object of one of the Operations has two parameters with the same name, but with different Locations ("in": "query" vs. "in": "path")

According to the spec, this should be valid: "A unique parameter is defined by a combination of a name and location."

When I generate code for this spec, the code has a typescript error "error TS2300: Duplicate identifier".

...
    "/MyPath/{myParam}": {
      "get": {
        ...,
        "parameters": [
          {
            "name": "myParam",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            },
            "x-position": 1
          },
          {
            "name": "myParam",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 2
          }
        ],
...

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions