一.您还必须在 Visual Studio 中通过 https://visualstudio.microsoft.com/downloads/ 安装以下依赖项:
JsonSubTypes 1.2.0
或者全部Newtonsoft.json 12.0.3
或者全部RestSharp 106.12.0
RateLimiter 2.2.0
或更新版本(这也将安装ComposableAsync.Core
)
二.要完成本教程,您需要满足以下先决条件:
- 处于草稿或已发布状态的混合或 SP-API 应用程序
- 集成开发环境 (IDE) 软件(本演练使用 Windows 操作系统上的 Visual Studio IDE)
三.具体开发步骤:
第 1 步。设置您的工作空间
-
在您的本地驱动器上,为该项目创建一个目录并将其命名
SwaggerToCL
。 -
下载以下工具。
- IDE software (this walkthrough uses Visual Studio IDE on Windows OS)
- GNU Wget
- Java 8 或更高版本
-
运行以下命令下载 Swagger 代码生成器:
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.13/swagger-codegen-cli-2.4.13.jar -O swagger-codegen-cli.jar
4. 复制 swagger-codegen-cli.jar
进入您的本地目录 C:\\SwaggerToCL
。
5. In GitHub, go to selling-partner-api-models/models at main · amzn/selling-partner-api-models · GitHub and use the following command to clone the selling-partner-api-models
repository to your local directory C:\\SwaggerToCL
.
git clone https://github.com/amzn/selling-partner-api-models
6.Navigate to the selling-partner-api-models\\models
folder in your local copy of the repository and copy a JSON file from the models subfolders into C:\\SwaggerToCL
. This tutorial uses the Sellers.json file.
7.In GitHub, go to selling-partner