【问题标题】:Walmart Marketplace API JSON Schema沃尔玛市场 API JSON 模式
【发布时间】:2021-02-03 12:58:07
【问题描述】:

沃尔玛推出了新版本的 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",
...

【问题讨论】:

    标签: jsonschema walmart-api


    【解决方案1】:

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

    【讨论】:

    【解决方案2】:

    自从这篇文章以来,v4.0 的架构发生了重大变化

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

    【讨论】:

      猜你喜欢
      • 2017-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多