PAXSTORE / paxstore-openapi-java-sdk

Cloud open api SDK for customer system to synchronize related data
Apache License 2.0
23 stars 30 forks source link

Confusion in SDK's Handling of `MerchantPageDTO` and `MerchantDTO` #24

Open mathmul opened 5 months ago

mathmul commented 5 months ago

Description

There appears to be a potential misunderstanding or error in how MerchantPageDTO and MerchantDTO are used and documented in the SDK. Specifically, the API method searchMerchant is documented to return Result<MerchantPageDTO>, which seems like something you'd expect, but is misleading given the structure and inheritance of MerchantPageDTO and MerchantDTO.

Issue Details

Expected Behavior

Ideally, MerchantPageDTO should either:

Suggested Fix

  1. All the properties, getters and setter from MerchantPageDTO should be moved to MerchantDTO
  2. MerchantDTO should no longer inherit from MerchantPageDTO
  3. MerchantPageDTO should be a DTO that contains a dataset/list of MerchantDTO objects
  4. Ideally, searchMerchant method would be renamed to searchMerchants
  5. Synchronize the documentation and method signatures in the SDK to accurately reflect the data structures being returned and handled

Steps to Reproduce

  1. Call the searchMerchant method with standard pagination parameters.
  2. Observe the returned Result<MerchantPageDTO> and note the lack of pagination handling or dataset encapsulation typically expected in such responses.

Possible Solutions

mathmul commented 3 months ago

Over a month since posting this and not even a comment? Has anyone else had this issue? Better yet, has anyone successfully implemented this part of the SDK?