[BUG][JAVA] Deprecated properties only get @Deprecated on the getter (base, feign, native, microprofile)

オープン 初心者向け
#25,567 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Inf1mum がすでに取り組んでいます。

2026年11月10日 から。

  • #25615 @Inf1mum による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
tooling

調査の方向性

指定されたJava POJOテンプレートを読みます。Java/pojo.mustacheと、Java/libraries以下のfeign、native、microprofileの各バリアントを確認し、okhttp-gsonの非推奨処理と比較します。次に、JavaClientCodegenTestで生成コードに関する該当テストを調べます。完了条件は、指定された各テンプレートで非推奨プロパティがフィールド、getter、setter、fluent setterに注釈を付け、生成結果を対象とするテストがあることです。

索引モデルが issue の本文から書いたものです。

説明

Issue: Bug
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.mustache
  • Java/libraries/native/pojo.mustache
  • Java/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.

主要言語
Java
スター
26.9k
フォーク
7.8k
平均マージ
2日 10時間
マージ済み PR(30日)
180

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenAPITools/openapi-generator のほかの issue

OpenAPITools/openapi-generator の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。