swagger-api / swagger-api/swagger-ui
Error "'path' must begin with '/' and be relative to an individual" when endpoint path contains =
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Windows
- Browser: Firefox, Edge
- Version: SaaS
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the supplied OAS 3.1 YAML as the reproduction in Swagger UI, focusing on the endpoint path containing '=' and the delayed validation error. Trace where the path is validated, then add a regression test demonstrating that this valid OData-style path is accepted without the error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100