swagger-api / swagger-api/swagger-core
Resolve JsonSchema refs
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 7.5k
- Forks
- 2.3k
- Avg merge
- 18h 1m
- Merged PRs (30d)
- 10
Description
Hi all,
I'm trying to get the Json Schema from the response which is possible by first fetching the schema and then calling the getJsonSchema() function like this:
Schema propsSchema = openAPI.getComponents().getSchemas().get("some-ref");
jsonSchema.getJsonSchema();
This works fine but the refs are not resolved. I did use the swagger-parser to resolve them first which is working fine. However it doesn't seem to be taken into account when generating the Json Schema. Anyone came across this?
Bram
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
Start by reproducing the shown getJsonSchema() flow with a schema fetched from openAPI components and compare it with the schema after swagger-parser resolution. Done means generated JSON Schema references are resolved consistently with the parser-resolved input.
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