swagger-api / swagger-api/swagger-editor
Reference to parameter object within path item object is marked as invalid in swagger editor
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 9.5k
- Forks
- 2.4k
- Avg merge
- 17h 15m
- Merged PRs (30d)
- 18
Description
As a result of #162, common paginator parameters are now referenced. Their definition resides under x-swagger-bake/components/parameters.
When validating a swagger file containing such references, the swagger editor complains: "OAS3 parameter $Ref should point to Parameter Object"
If I manually move or copy the parameter definition to components/parameters and change the $ref path to the new location, the editor does not complain any more:
I can also change the new definition under components/parameters to be itself a reference and to point to the concrete definition under x-swagger-bake/components/parameters. That validates as well.
According to the OpenAPI specification, references for such parameters should be defined in components/parameters:
Thus, can the definition under x-swagger-bake/components/parameters (and referencing those definitions directly from path items) be valid under any circumstances?
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
No source file or test is named. Reproduce the validation error with a parameter under x-swagger-bake/components/parameters, then compare it with the equivalent reference through components/parameters. Done means the editor behavior is checked against the OpenAPI rule and the validity of the direct reference is clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100