Skip to content

Latest commit

 

History

History

README.md

JsonListingSchemaValidationSampleApp

Introduction

This app demonstrates how to use the APIs listed in Building Listings Management Workflows Guide to build a sample specifically for JSON listing schema validation. The app covers steps

  1. Check item exist in the Amazon Catalog.
  2. Find listing restrictions if item exist
  3. Search Product type given the keywords and get Amazon recommended product type
  4. Get the json schema and meta schema of the given product from the product type definition API
  5. Store the two schema files locally
  6. use online json editor tool to fillout the values
  7. Store the json values payload locally
  8. Validate the json payload against the schema and check any syntax error
  9. Send putListingItem request with validation preview mode

Getting Started

Prerequisites

  1. This app requires Java 11 or above, so please install a supported version
  2. This sample app is build using the SP-API Java SDK So make sure your project has this dependency in latest version. As of May/21/2025, the latest version is 1.5.6
    <dependency>
        <groupId>com.networknt</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>1.5.6</version>
    </dependency>
  1. This sample app is using netoworknt as its open sourced JSON schema validate library but you could use own one. And here is the Maven dependency look like
    <dependency>
        <groupId>com.networknt</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>1.5.6</version>
    </dependency> 

How to run the app

  1. Check out the repository to your computer from Git
  2. Edit config.yml file to include all the necessary values such as client id, client secret, and refresh token
  3. Use IntelliJ to open the project
  4. Navigate to the Main.java and click the Run button
  5. Check the printed result in the console

See also

  1. SP-API documentation
  2. Building Listings Management Workflows Guide
  3. Listing JSON Schema Specification
  4. SP-API SDK