Skip to content

URI-encoded path parameters get broken #256

Closed
@TorstenForth

Description

@TorstenForth

Hi,

I submit a string containing the '/' character with Swagger UI in the browser (as a path parameter).
When I receive the string in req.params, the string contains the URI-encoded '%2F'.

I was debugging into the source code and found out that the req.params (which are URI-decoded by Express) are overwritten with the original (not URI-decoded) values.
The params are overwritten in the file src/index.ts, line 140 of Commit 00273f7

``

  if (openapi?.pathParams) {
    const { pathParams } = openapi;
    // override path params
    req.params[name] = pathParams[name] || req.params[name];
  }

``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions