Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI定義でMarisとの差分を小さくする #475

Closed
2 tasks
1nu1taichi opened this issue Jan 29, 2024 · 2 comments · Fixed by #683
Closed
2 tasks

OpenAPI定義でMarisとの差分を小さくする #475

1nu1taichi opened this issue Jan 29, 2024 · 2 comments · Fixed by #683
Assignees
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Milestone

Comments

@1nu1taichi
Copy link
Contributor

1nu1taichi commented Jan 29, 2024

概要

OpenAPI定義でMarisと差分があり、自動生成コードにも差分が生じている
この原因を調査し、可能な限りクライアントサイドが同じコードで運用できるように改善する

詳細

APIメソッドクラス名

Maris : basketItemsApi
Maia : basketItemApi
のようにAPIメソッドクラスの名称が単数形となっているため複数形に修正する

使用されているAPIメソッドクラス名での差分は以下の通り

Maris Maia
AssetsApi AssetApi
BasketItemsApi BasketItemApi
CatalogBrandsApi CatalogBrandApi
CatalogCategoriesApi CatalogCategoryApi
CatalogItemsApi CatalogItemApi
OrdersApi OrderApi

APIモデルクラス

使用されているモデルクラスでの差分は以下の通り

Maris Maia
PutBasketItemsRequest PutBasketItemRequest
CatalogCategoryResponse CatalogCategory
CatalogBrandResponse CatalogBrand
PagedListOfCatalogItemResponse PagedCatalogItemResponse

完了条件

  • APIメソッドクラス名が複数形に修正されている
  • APIモデルクラス名がMarisと揃っている
@tsuna-can-se tsuna-can-se added the target: Dressca サンプルアプリケーションDresscaに関係がある label Feb 29, 2024
@tsuna-can-se tsuna-can-se added this to the v0.8 milestone Feb 29, 2024
@ykinoshita4
Copy link
Contributor

以下のように修正し、apiのjsonファイルを確認する。

・APIメソッドクラス名
@tagのnameをMarisに合わせて修正

・APIモデルクラス
PutBasketItemRequest、PagedCatalogItemResponseについて、クラス名をMarisに合わせて修正
CatalogCategory、CatalogBrandについて、@Schemaのimplementationに設定したクラスが誤っていたため修正

@ykinoshita4 ykinoshita4 linked a pull request Apr 12, 2024 that will close this issue
@ykinoshita4
Copy link
Contributor

レビュにより以下追加指摘(以下以外はMarisとの差分が無い状態)
・basket-item-api.tsの putBasketItem(s) について、Itemがmarisが複数形、maiaが単数形となっておりどちらかに揃えたい

リストを受け取るインターフェース(複数アイテムのputを受け入れる)なので、marisに合わせて複数形とする。
修正対象は以下
・BasketItemController.javaのメソッド名を複数形に修正する(修正後、apiのjsonを再作成し、generatorでtsファイルを生成する)
・生成したbasket-items-api.tsに差し替える
・修正対象のメソッドを呼び出しているコード(basket.ts)を修正する

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants