swagger-api / swagger-api/swagger-core
Custom NotNull annotations stopped working between 2.2.28 and 2.2.29
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 7.5k
- Forks
- 2.3k
- Avg merge
- 18h 1m
- Merged PRs (30d)
- 10
Description
I'm using springdoc to generate OpenAPI documents for my application. In order to generate improved error messages, I'm using my own @NotNull annotations instead of jakarta.validation.constraints.NotNull. This was working fantastic for me until swagger v2.2.29, when my @NotNull annotations stopped generating the appropriate required fields.
See more details here: https://github.com/springdoc/springdoc-openapi/issues/3004#issuecomment-2955732679.
Ideally I would like the previous behavior reinstated where I can use any annotation with the name NotNull to mark required fields.
If that does not happen, are there any extension points I can use to keep my model generation working? I have hundreds of models annotated with @NotNull, and maintaining this is essential for my api clients to work 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
Start by comparing swagger versions 2.2.28 and 2.2.29, then review the linked springdoc issue comment for the changed custom @NotNull behavior. Trace how annotations are recognized during model generation and determine whether prior required-field output can be restored or an extension point can support existing models.
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
- Mostly clear
- Newbie friendliness
- 35/100