eclipse-vertx / eclipse-vertx/vertx-codegen
Abstract data object support in params
- 主要言語
- Java
- スター
- 111
- フォーク
- 89
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Data object params needs to be a plain class because it needs to be reconstructed from Json format (for example in JavaScript or Groovy). This is now not possible because the code generator will not know which data object to create.
We could work around this by having a static method `fromJson` returning an instance of that object that would be invoked by the generator, delegating the responsibility of creating the right instance to this method. This method could either use some hard coded mechanism or something else.
For example:
```
@DataObject
public abstract class AuthOptions {
public static AuthOptions fromJson(JsonObject object) {
...
}
}
```
This would allow for example the use of a common data object in service proxies or configuration.
コントリビューションガイド
調査の方向性
まず、コードジェネレーターが @DataObject パラメーターをどのように処理し、JsonObject 値をどのように再構築するかを追跡します。提案されている静的なエントリーポイント AuthOptions.fromJson(JsonObject) と、現在の生成パラメーター処理を比較します。サービスプロキシまたは設定に対して、抽象データオブジェクトパラメーターを JSON から再構築でき、AuthOptions の例をカバレッジに含められれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100