Skip to content

OpenApiValidator's match middleware doesn't parse path params #81

Description

@wilcoxpdfrd

If an express route includes any path parameters (/foo/:bar, which the swagger represents as /foo/{bar}), and the match middle ware is configured, when the OpenAPIValidator validate method is called, the req.params are empty, whereas we expect req.params = { bar: '[steel|...]' } ...

It seems as though match has its own routing logic perhaps that doesn't include the step to parse the path parameters the same way the express route logic does?

In any event this seems like an issue that should either be fixed or the documentation changed to not use the match middleware if a route includes any parameters.

Activity

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

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