[BUG][JAVA] Deprecated properties only get @Deprecated on the getter (base, feign, native, microprofile)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read the listed Java POJO templates: Java/pojo.mustache and the feign, native, and microprofile variants under Java/libraries; compare their deprecation handling with okhttp-gson. Then inspect JavaClientCodegenTest for the relevant generated-code tests. Done means deprecated properties annotate the field, getter, setter, and fluent setter in each listed template, with tests covering the generated output.
Written by the indexing model from the issue text.
Description
Description
If a property is marked deprecated: true, the Java client only puts @Deprecated on the getter.
The field, setter and fluent setter don't get it, so you only get a compiler warning when reading
the value, not when setting it:
private String name; // no @Deprecated
public Pet name(String name) { ... } // no @Deprecated
@Deprecated
public String getName() { ... }
public void setName(String name) { ... } // no @Deprecated
I'd expect all of them to be annotated, the way okhttp-gson does it since #15287 (#15286).
jersey2 and jersey3 do it too. These templates still don't:
Java/pojo.mustache(e.g.resttemplate,webclient)Java/libraries/feign/pojo.mustacheJava/libraries/native/pojo.mustacheJava/libraries/microprofile/pojo.mustache
Checked with 7.27.0 and current master.
The same thing was reported for JavaSpring in #24704 (PRs #24705, #24762).
Question
Was there a reason these were left out of #15287, or did they just get missed? If it's the
latter, I'm happy to open a PR that does the same as #15287 for the templates above and adds
tests to JavaClientCodegenTest.
- Dominant language
- Java
- Stars
- 26.9k
- Forks
- 7.8k
- Avg merge
- 2d 23m
- Merged PRs (30d)
- 177
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from OpenAPITools/openapi-generator
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenAPITools/openapi-generator#25768 ·
Maintainers usually reply within 1 day
-
Enhancement: Feature
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenAPITools/openapi-generator#25753 ·
Maintainers usually reply within 1 day
-
[BUG][RUBY-NEXTGEN] A non-String value in a pattern-constrained attribute raises NoMethodErrorPossibly taken @Inf1mum claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenAPITools/openapi-generator#25724 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG][RUBY-NEXTGEN] Response#to_hash is advertised and raises when the data is an ArrayPossibly taken @Inf1mum claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
OpenAPITools/openapi-generator#25723 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG][RUBY-NEXTGEN] A JSON string response raises ApiError because the body is parsed twicePossibly taken @Inf1mum claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
OpenAPITools/openapi-generator#25719 · 1 comment ·
Maintainers usually reply within 1 day
All issues in OpenAPITools/openapi-generator
Similar issues
-
good first issue kernel
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
JackFurton/who-would-build-a-kernel-in-java#316 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GTNewHorizons/Angelica#2370 ·
Maintainers usually reply within 1 day
-
Long working directory path draws over the Console pane's buttons when the Console has no other tabsOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
proposal
Difficulty 1/5 Under an hour Newbie friendliness 82/100
beemdevelopment/Aegis#1861 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
foam-foundation/foam3#5917 ·
Maintainers usually reply within 1 day