Update REST API classes to remove extraneous wrapper classes
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- java, spring-boot
調査の方向性
Webhook と Product を含む REST API のモデルクラスから始め、Jackson のラッパーアノテーションが単一オブジェクトとコレクションをどのように扱うかを比較します。文書化されている Product と products のレスポンス形式を再現し、そのうえで両方のデシリアライズ形式を維持したまま Root ラッパーを削除できるかを判断します。この issue では具体的なファイルやテストは特定されていません。
索引モデルが issue の本文から書いたものです。
説明
Much of the REST API model has "Root" classes which are just wrappers to handle the name of a JSON node.
I think we can get rid of all of those, by defining the actual model classes with a couple JSON annotations. An example is the Webhook class:
@JsonTypeName(value = "webhook")
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
Update:
This is trickier than expected. The main approach works fine for single item use, but causes issues when there's an array of items being mapped to a collection.
For example, for a single Product call, Shopify returns something like:
{
"product": {
"id": 632910392,
"title": "IPod Nano - 8GB",
"body_html": "
It's the small iPod......
Which is why we need the Product class to have the As.WRAPPER_OBJECT annotation (or the wrapper class).
However, when getting an array of products, Shopify sends in something like this:
{
"products": [
{
"id": 632910392,
"title": "IPod Nano - 8GB",
"body_html": "
It's the small iPo
Note the lack of "product" level nodes. That's what breaks here. So basically we want Product to wrap itself with a "product" node if it's a single Product, but to NOT wrap itself when its an array or collection. I can't find any easy way to do this. A custom de-serializer is an option, but I'm not sure that's a lot better/cleaner than these wrapper classes....
- 主要言語
- Java
- スター
- 55
- フォーク
- 18
- 平均マージ
- 7時間 14分
- マージ済み PR(30日)
- 4
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
devondragon/SpringShopifyAppFramework のほかの issue
-
documentation enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
devondragon/SpringShopifyAppFramework#32 · コメント 10 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
-
enhancement
devondragon/SpringShopifyAppFramework#24 · コメント 1 件 · 担当者 1 名 ·
-
devondragon/SpringShopifyAppFramework#12 · コメント 5 件 · 担当者 1 名 ·
devondragon/SpringShopifyAppFramework の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
inu-appcenter/memorIN-backend#288 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
frontend maui-pilot pilot-ask question
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
area/plugin
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kestra-io/plugin-kestra#190 ·