0

Walmart 引入了新版本的 Marketplace API 架构 (v4):https ://developer.walmart.com/#/apicenter/marketPlace/latest#theItemObject 并且与以前的版本不同,它只提供 JSON 格式(以前的版本有 XSD模式)。我想将架构转换为实体,但事实证明这些文件实际上并不是经典的JSON 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",
...
4

2 回答 2

0

自从这篇文章以来,架构已经对 v4.0 进行了重大更改

最新的架构在这里https://developer.walmart.com/image/asdp/us/mp/item/spec/4.0/MP_ITEM_SPEC_4.0.json

于 2020-12-16T20:55:20.860 回答
0

该站点上的实际架构文件包含"$schema": "http://json-schema.org/draft-04/schema#",它指示正在使用的 JSON 架构的版本。您粘贴的是一个示例负载,这就是它看起来不像 JSON 模式的原因。

于 2020-10-20T20:37:55.137 回答