swagger-api / swagger-api/swagger-core

ModelResolver#resolve ignores TYPE_USE annotations on property types

Open
#4,848 7 comments 29 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.