Walmart Marketplace API JSON Schema

982 views Asked by At

Walmart introduced a new version of the Marketplace API schema (v4): https://developer.walmart.com/#/apicenter/marketPlace/latest#theItemObject and, unlike previous versions, it only provides the JSON format (previous versions had XSD schemas). I wanted to convert the schema into entities but it turned out the files were not actually classic JSON Schema. Does anybody know what format it is and if there's any tools for parsing and converting it?

Example of a schema: https://developer.walmart.com/xsd/marketplace/items/Spec-4.0/MP_ITEM_SPEC_4.0.json

{
    "Headers": {
        "key": "headers",
        "name": "Headers",
        "attributes": {
            "requestId": {
                "key": "request_id",
                "name": "Request ID",
                "xmlName": "requestId",
                "requirementLevel": "Recommended",
                "closedList": "N",
                "multiSelect": "N",
                "minDataLength": 1,
                "maxDataLength": 64,
                "isComplex": false,
                "isChild": false,
                "children": [
                    [
                        "Request ID",
                        "requestId"
                    ]
                ],
                "rank": 1000,
                "dataType": "String",
                "definitions": "Partner's ID of the feed, partner's ID to correlate feed and feed response.",
                "dataDefinitions": "Alphanumeric, 64 characters - Partner's ID of the feed, partner's ID to correlate feed and feed response."
            },
            "requestBatchId": {
                "key": "request_batch_id",
                "name": "Request Batch ID",
                "xmlName": "requestBatchId",
                "requirementLevel": "Recommended",
                "closedList": "N",
                "multiSelect": "N",
                "minDataLength": 1,
                "maxDataLength": 64,
                "isComplex": false,
                "isChild": false,
                "children": [
                    [
                        "Request Batch ID",
                        "requestBatchId"
                    ]
                ],
                "rank": 2000,
                "dataType": "String",
                "definitions": "Represents external generated batchId",
                "dataDefinitions": "Alphanumeric, 64 characters - Represents external generated batchId"
            },
            "feedDate": {
                "key": "feed_date",
                "name": "Feed Date",
                "xmlName": "feedDate",
                "requirementLevel": "Recommended",
...
2

There are 2 answers

2
Ether On

The actual schema files on that site contain "$schema": "http://json-schema.org/draft-04/schema#", which indicates the version of JSON Schema in use. What you pasted was an example payload, which is why it doesn't look like a JSON Schema.

0
Don On

Since this post the schema has had major changes for v4.0

The latest schema is here https://developer.walmart.com/image/asdp/us/mp/item/spec/4.0/MP_ITEM_SPEC_4.0.json