swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
25.96k stars 8.85k forks source link

Error "'path' must begin with '/' and be relative to an individual" when endpoint path contains = #10009

Open dominikforal opened 2 weeks ago

dominikforal commented 2 weeks ago

Q&A (please complete the following information)

Example Swagger/OpenAPI definition:

  /me/RecentCommunication(senderEmail='{senderEmail}'):
    get:
      summary: Recent requests with e-mail sender
      tags:
        - Internal
      parameters:
        - in: path
          name: senderEmail
          schema:
            type: string
          required: true
        - $ref: '#/components/parameters/odata.top'
        - in: query
          schema:
            type: string
          name: $expand
          description: >-
            Include linked resources with retrieved resources with <a
            href="http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752359"
            target="_blank">OData v4.0 $expand</a>
          examples:
            requester:
              value: requester
            service:
              value: service
            coRequesters:
              value: coRequesters
            objects:
              value: objects
            state:
              value: state
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SD.TicketsApiResponse'
        '500':
          $ref: '#/components/responses/ServerError'

Describe the bug you're encountering

I have an OData function as a part of my API with the following path: /me/RecentCommunication(senderEmail='{senderEmail}'):

Shortly after I updated my spec to 3.1.0 an error "'path' must begin with '/' and be relative to an individual" occured. It is strange that error does not appear immediately but after a few minutes. I have never had any issues with this path before and it is OK on the older version of this API (OAS version 3.0.0). It seems to be related to '=' in the function path.

YAML is valid and this endpoint is displayed correctly in API doc. So it seems as a bug to me.

Any suggestions?

Screenshots

image