mapstruct / mapstruct/mapstruct
mapstruct native support protobuf
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 7.7k
- フォーク
- 1.1k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Use case
The reasons are as follows:
-
gRPC use protobuf ,Jakarta EE 10 choise gRPC as Jakarta RPC , . Net Core same choise gRPC.
-
It is a good idea in the near future that protobuf will be selected as the data exchange foundation of heterogeneous platforms for service mash of microservice architecture.
-
MapStruct is not friendly to protobuf. For a long time, it will inevitably generate new components instead of building on the MapStruct foundation. It may introduce technologies similar to ByteBuf to improve the copy efficiency.
-
No configuration is better than complex configuration. Most people choose MapStruct not to learn complex configuration, but to improve efficiency. In complex scenarios, customers write code instead of configuring MapStruct, which seems to go further and further. What is the original intention of the project? Is the goal of the project to solve complex situations through configuration?
I look forward to your reply!
Generated Code
Bean Map copy to Protobuf Map putAll Error : UnsupportedOperationException.
correct:
basicTestMessageMap.putAllTestStrMap(map);
replace
basicTestMessageMap.getTestStrMap().putAll( map );
@Override
public BasicTestMessageMap toMap(BasicTestBeanMap beanMap) {
if ( beanMap == null ) {
return null;
}
BasicTestMessageMap.Builder basicTestMessageMap = BasicTestMessageMap.newBuilder();
if ( basicTestMessageMap.getTestStrMap() != null ) {
Map<String, String> map = beanMap.getTestStrMap();
if ( map != null ) {
basicTestMessageMap.getTestStrMap().putAll( map );
}
}
return basicTestMessageMap.build();
}
Possible workarounds
No response
MapStruct Version
1.5.3.Final
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、生成された BasicTestMessageMap mapper に示されている protobuf map mapping を再現し、getter ベースの putAll 呼び出しで発生する UnsupportedOperationException を確認します。生成されたコードを要求された builder map operation と比較します。protobuf map mappings がその例外なしで動作し、意図した生成動作が regression test でカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- backend-api-design
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100