Simplify the AnnotationIntrospector SPI: return a ClassInfo instead of many per-element queries
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず opa-evaluator の AnnotationIntrospector と DefaultAnnotationIntrospector を読み、次に opa-jackson の実装と mapper の呼び出し箇所を調査します。ClassInfo 型のディスクリプタで、遅延解決または部分解決を維持しながら、一覧にあるメタデータを保持できるか確認します。SPI と影響を受ける実装および呼び出し箇所が合意された単一エントリポイントの契約を使用し、サポート対象のメタデータと null 引数の動作をテストでカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Follow-up from PR #110 review: https://github.com/open-policy-agent/java-opa-sdk/pull/110#discussion_r3644681150 (johanfylling).
Context
AnnotationIntrospector (in opa-evaluator, io.github.open_policy_agent.opa.mapper) is the SPI the mapper consults to resolve annotation-driven property metadata without binding the evaluator to a specific JSON library. Today it exposes many fine-grained "ask a question" methods:
String findPropertyName(Method getter, Field backingField);
boolean isIgnored(Method getter, Field backingField);
boolean isNonNullInclude(Method getter, Field backingField);
String findCreatorParamName(Parameter param);
boolean isJsonCreator(Constructor<?> ctor);
boolean isJsonCreator(Method method);
Visibility findFieldVisibility(Class<?> clazz);
boolean isJsonValue(Method method);
Proposal
As suggested in review, consider inverting the shape: instead of the mapper asking the introspector a series of questions per element, give the introspector a Class<?> and have it hand back a resolved descriptor (e.g. ClassInfo) that carries the property names, ignored set, null-inclusion, creator info, visibility, and JSON-value method in one pass.
Potential benefits:
- Simpler SPI surface (one entry point instead of eight).
- Implementations can resolve a class once rather than being re-queried per getter/field/parameter.
- Clearer contract for the null-argument combinations that the current per-element methods have to document.
Scope / notes
- Not blocking; raised on PR #110 as out of scope for that change.
- Affects
opa-evaluator(the SPI +DefaultAnnotationIntrospector) and theopa-jacksonimplementation, plus the mapper call sites. - Worth confirming the one-pass model still supports lazy/partial resolution where the mapper only needs a subset.
- 主要言語
- Java
- スター
- 20
- フォーク
- 30
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 34
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-policy-agent/java-opa-sdk のほかの issue
-
CLI metrics table renders blank cells for counters and histograms対応中かも @lbarrosby が 3 日前に担当しました。 オープンbug metrics
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
open-policy-agent/java-opa-sdk#221 ·
メンテナーはふだん 1 日以内に返信
-
Implement http.send builtin対応中かも @sakshichitnis27 が 5 日前に担当しました。 オープンbuiltins enhancement evaluator help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
open-policy-agent/java-opa-sdk#140 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
builtins enhancement evaluator
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
open-policy-agent/java-opa-sdk#139 ·
メンテナーはふだん 1 日以内に返信
-
Implement union builtins (union, object.union)再び着手できるかも @ML-dev-crypto が 116 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbuiltins enhancement evaluator good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
open-policy-agent/java-opa-sdk#137 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
builtins enhancement evaluator
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
open-policy-agent/java-opa-sdk#136 ·
メンテナーはふだん 1 日以内に返信
open-policy-agent/java-opa-sdk の issue をすべて見る
似ている issue
-
bug main ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openhab/openhab-webui#4671 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
NearVanilla/IceCream#109 ·
メンテナーはふだん 1 日以内に返信
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
bancolombia/bin-stash#79 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信