Skip to content

Invalid OpenAPI path param generated for "Named wildcard" path #3309

Description

@gleant

Describe the bug

Ts.ED supports named wildcards in routes (e.g. /:param*, but the generated OpenAPI/Swagger specification produces an invalid path template.

To Reproduce

Create controller

@Controller("/merged")
export class MyController {
  @Get("/:moduleUri*")
  get(@PathParams("moduleUri") moduleUri: string) {
    return moduleUri;
  }
}

That creates swagger.json path

{
  "paths": {
    "/merged/{moduleUri*}": {
      "get": {
        "parameters": [
          {
            "name": "moduleUri*",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  }
}

Expected behavior

The path param should not contain *.

Code snippets

Repository URL example

No response

OS

macOS

Node version

22.21.0

Library version

v8.25.4

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions