Skip to content

Multiple path params break support for URI path param #887

Closed
@Mitchell3514

Description

@Mitchell3514

Describe the bug
As per the FAQ, we should be able to define paths that end on a path parameter acting as a wildcard/use URI format.
However, when we introduce a second path parameter, the middleware always throws an error and the server returns status code 500.

To Reproduce

  1. Create the validation middleware using an OpenAPI specification that includes a path with multiple path parameters of which the last (at the end) is a wildcard as per RFC-6570. For example:
    /namespaces/{id}/files/{path}*:
      get:
        parameters:
          - name: path
            in: path
            required: true
            schema:
              type: string
  2. Create an Express application with the middleware and call any (existing or non-existing) route.

Actual behavior
The middleware always responds with 500 - Internal Server Error

Expected behavior
The middleware validates the internal path parameter as per usual and parses the wildcard parameter at the end.

Examples and context
Original use-case: #457 implemented in #491
I have added a commit to my fork that includes tests which reproduce this issue: Mitchell3514@0c55318

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