swagger-api / swagger-api/swagger-codegen-generators
[JavaSpring] Should use requiredMode instead of deprecated required attribute of Schema class
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
Description
When using spring in the recent versions of swagger-codegen-generators, we get a lot of deprecation warnings about the required attribute of the Schema class being deprecated.
/path/to/project/build/generated/sources/swagger/java/main/com/example/api/model/Info.java:57: warning: [deprecation] required() in Schema has been deprecated
@Schema(required = true, description = "Name")
Version
1.0.60
Can you identify when the issue first appeared?
Not yet, but I'll get back to you
Language / Generator Affected
Spring (and possibly other Java based generators too)
Additional Context
Checklist
- I have searched the existing issues to avoid duplicates.
- I have included a minimal reproducible spec or configuration.
- I have clearly described the steps to reproduce the issue.
- I have specified which generator or template is affected.
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 with the Spring generator that produces the generated Info.java example and locate where its @Schema annotation is assembled. Check the generated annotation for the deprecated required attribute, then verify that the output uses requiredMode and no longer emits the deprecation warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100