https://github.com/wppurking/spapi
spapi generate
https://github.com/wppurking/spapi
Last synced: 3 months ago
JSON representation
spapi generate
- Host: GitHub
- URL: https://github.com/wppurking/spapi
- Owner: wppurking
- License: apache-2.0
- Created: 2021-03-04T09:56:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-23T03:26:40.000Z (almost 4 years ago)
- Last Synced: 2025-01-21T12:47:20.774Z (5 months ago)
- Language: Java
- Size: 18.3 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Selling Partner API Models
This repository contains Swagger models for developers to use to create software to call Selling Partner APIs. Developers can use [swagger codegen](https://github.com/swagger-api/swagger-codegen) to generate client libraries from these models. Please refer to [selling-partner-api-docs](https://github.com/amzn/selling-partner-api-docs) for additional documentation and read the [Selling Partner API Developer Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md) for instructions to get started.The [models directory](https://github.com/amzn/selling-partner-api-models/tree/main/models) contains all of the currently available Selling Partner API models.
The [clients directory](https://github.com/amzn/selling-partner-api-models/tree/main/clients) contains a [Java library](https://github.com/amzn/selling-partner-api-models/tree/main/clients/sellingpartner-api-aa-java) and a [C# library](https://github.com/amzn/selling-partner-api-models/tree/main/clients/sellingpartner-api-aa-csharp) with mustache templates for use with [swagger-codegen](https://swagger.io/tools/swagger-codegen/) to generate client libraries with authentication and authorization functionality included. The templates are located in *resources/swagger-codegen*.
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## License
This project is licensed under the Apache-2.0 License.
## 使用说明
因为需要为每一个 api 的描述文件生成 api, 而且 amazon 的 api 很多, 所以使用 ruby 脚本进行处理, 其中步骤有:
1. 设定好 groupId, artifactId, template, invokerPackage 等生成主体的 api 代码
2. 复制需要的 SellingPartnerAPIAA 与 Documents API
3. 调整 gradle 的信息, build.gradle 与依赖使用:
* 更新 /build.gradle 中的库版本
* ruby generate.rb
* 将代码 cp 到对应目录, 例如: cp -r codegen/* /Users/wyatt/Programer/gitlab/amazon-sp-api/
* 需要将 messaging/Schema 与 solicitations/Schema 中的 @Schema 与 Schema 区分开. 手动修改 @Schema 变为 @io.swagger.v3.oas.annotations.media.Schema
* 最后在 /amazon-sp-api/ 生成 jar 与 sourcedoe, ./gradlew publishToMavenLocal
* 将 ~/.m2/repository/com/amazon/spapi 的对应版本的文件, 上传到对应位置