swagger-api / swagger-api/swagger-ui
OpenAPI 3.1.0 support: Individual path method reference not resolving.
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 10
- Browser: Chrome
- Version: 114.0.5735.90
- Method of installation: docker: https://hub.docker.com/r/swaggerapi/swagger-ui
- Swagger-UI version: 5.1.0
- Swagger/OpenAPI version: 3.1.0
Content & configuration
Swagger/OpenAPI definition:
In oas_paths.yaml:
openapi: 3.1.0
info:
version: 1.0.0
title: Customer Paths
paths:
"/customer":
get:
...
post:
...
In oas_main.yaml:
openapi: 3.1.0
info:
version: 1.0.0
title: Customers
paths:
# This works, including both the get and post methods for this path.
"/customer":
$ref: './oam_paths.yaml#/paths/~1customer'
# This does NOT work to include just the get method:
"/customer":
get:
$ref: './oam_paths.yaml#/paths/~1customer/get'
Swagger-UI configuration options:
Using out-of-the-box docker image.
In docker-compose file:
image: swaggerapi/swagger-ui:v5.1.0
?yourQueryStringConfig
Screenshots
How can we help?
When I use https://www.npmjs.com/package/@apidevtools/swagger-parser to bundle the spec into a single document, I can include just the get method and it renders as expected using swagger-ui, so is this a bug in swagger-ui that it is not resolving this reference correctly?
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
Reproduce the report with the Swagger UI v5.1.0 Docker image and the two OpenAPI 3.1.0 YAML examples. Start by tracing how Swagger UI resolves the individual GET reference, then verify that the referenced method renders while the whole-path reference continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, openapi
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100