swagger-api / swagger-api/swagger-core
ModelResolver#resolve ignores TYPE_USE annotations on property types
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 7.5k
- Forks
- 2.3k
- Avg merge
- 18h 1m
- Merged PRs (30d)
- 10
Description
We're using the JSpecify annotations (which will become the default nullability annotations in Spring Framework 7) and we encountered an issue with Swagger-core capabilities.
These nullability annotations are properly targeting TYPE_USE element type, which is currently not read at all by the io.swagger.v3.core.jackson.ModelResolver#resolve, making it impossible to set OpenAPI properties (such as eg. nullability) automatically.
- Do you see any blocker why TYPE_USE annotations should not be considered by the ModelResolver?
- Do you see any way around until the swagger-core is improved?
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 at io.swagger.v3.core.jackson.ModelResolver#resolve and trace how annotations on property types are currently handled. Done means TYPE_USE annotations such as JSpecify nullability annotations are considered so relevant OpenAPI property metadata can be generated automatically; the issue does not name a test or file path.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100