swagger-api / swagger-api/swagger-parser
Unable to resolve reference attribute in multiple yaml files
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Hi
We have multiple yaml (a.yaml and b.yaml) file and we have $ref from one attribute which defined in another file. We have one attribute in a.yaml whose type is defined in b.yaml. Our expectation is to parse yaml files and find the attribute type ;
We are parsing using swagger-parse
OpenAPI openAPI = new OpenAPIV3Parser().read("/opt/SwaggerParser/a.yaml")
and tried also OpenAPI openAPI = new OpenAPIV3Parser().read("/opt/SwaggerParser/").
Both the approach fails to achieve expected result. Appreciate for any suggestion.
Thanks
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 case using a.yaml and b.yaml, where an attribute in a.yaml references a type defined in b.yaml, and compare both OpenAPIV3Parser.read(...) calls shown in the report. Trace external-reference resolution from those entry points and verify that the parsed attribute exposes its referenced type; the issue is done when the multi-file YAML case resolves consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100