0

下面的销售合作伙伴 API 文档给出了为 java 的 Sellersapi 生成 sdk 客户端的示例,但没有给出 csharp 的任何示例。我设法为 cSharp 创建了 1 个和多个 API(例如 Feed、Orders、Tokens、Fullfilmentoutbound)。但是我遇到的问题是 Orders 和 Fulfillmentoutbound 中存在 Money 类,因此具有fulfillmentoutbound 的类在 Orders Money 类中被覆盖

https://github.com/amzn/ sell-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md#swagger-codegen-cli.jar

我使用的命令如下

java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/orders-api-model/ordersV0.json --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/feeds-api-model/feeds_2020-09-04.json --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/reports-api-model/reports_2021-06-30.json --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/tokens-api-model/tokens_2021-03-01.json --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/fulfillment-outbound-api-model/fulfillmentOutbound_2020-07-01.json --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/merchant-fulfillment-api-model/merchantFulfillmentV0.json --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'

任何人都知道我可以做什么,这样它就不会被覆盖,或者目前它为同一文件夹中的所有 api 端点添加所有模型类,可能会将它们全部创建在单独的文件夹中,以便它们的端点可以工作

4

1 回答 1

0

所以我已经能够使用下面的命令来做到这一点,这里我们在他们的 API 和 Models 文件夹下创建文件

java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/orders-api-model/ordersV0.json --api-package Api.Orders --model-package Models.Orders --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/feeds-api-model/feeds_2020-09-04.json --api-package Api.Feeds --model-package Models.Feeds --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/reports-api-model/reports_2021-06-30.json --api-package Api.Reports --model-package Models.Reports --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/tokens-api-model/tokens_2021-03-01.json --api-package Api.Tokens --model-package Models.Tokens --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/fulfillment-outbound-api-model/fulfillmentOutbound_2020-07-01.json --api-package Api.FulFillmentOutBound --model-package Models.FulFillmentOutBound --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
java -jar swagger-codegen-cli-2.4.13.jar generate -l csharp -i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/merchant-fulfillment-api-model/merchantFulfillmentV0.json --api-package Api.MerchantFulFillment --model-package Models.MerchantFulFillment --additional-properties -DmodelTests=false -DapiTests=false -DpackageName='AmazonSPAPI.Sdk'
于 2022-01-31T17:48:21.127 回答