0

如何构建自己的 json 模式来验证从 api 返回的 json 是相同的结构?我有这个示例 JSON

{
  "httpStatus": 200,
  "httpStatusMessage": "success",
  "timestamp": "2020-11-11T19:32:45",
  "response": {
    "header": {
      "SchoolId": 10006,
      "SchoolName": "Naples"
    },
    "body": {
      "dataProviders": [
        {
          "dataProviderId": 14,
          "students": [
            {
              "studentId": 1000611000,
              "driverGrade": "Junior",
              "firstName": "Authur",
              "lastName": "Boccuto"
            },
            {
              "studentId": 1000611001,
              "studentGrade": "Senior",
              "firstName": "Antwan",
              "lastName": "Carter"
            }
          ]
        }
      ]
    }
  }
}

有时它可能具有不同的结构,我需要构建自己的 json 模式以在操作 json 数据之前验证它是否相同。如何构建自己的架构以确保它具有有效的结构?

4

0 回答 0