json Yelp的-的OpenAPI

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json Yelp的-的OpenAPI相关的知识,希望对你有一定的参考价值。

{
  "swagger": "2.0",
  "info": {
    "version": "1.0",
    "title": "Yelp V3",
    "description": "Yelp's Fusion API allows you to get the best local business information and user reviews of over million businesses in 32 countries",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "host": "api.yelp.com",
  "basePath": "/v3",
  "securityDefinitions": {
    "auth": {
      "type": "oauth2",
      "flow": "application",
      "tokenUrl": "https://api.yelp.com/oauth2/token",
      "scopes": {}
    }
  },
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/businesses/search": {
      "get": {
        "description": "",
        "summary": "/businesses/search",
        "operationId": "/businesses/search",
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": true,
            "type": "string",
            "description": ""
          },
          {
            "$ref": "#/parameters/latitude"
          },
          {
            "$ref": "#/parameters/longitude"
          },
          {
            "$ref": "#/parameters/Authorization"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "auth": []
          }
        ],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/v3/businesses/search?term=delis&latitude=37.786882&longitude=-122.399972",
              "headers": {
                "Authorization": "Bearer"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "/businesses/search",
            "x-testDescription": ""
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/businesses/{id}": {
      "get": {
        "description": "",
        "summary": "/businesses/{id}",
        "operationId": "/businesses/{id}",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "default": "north-india-restaurant-san-francisco"
          },
          {
            "$ref": "#/parameters/Authorization"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "auth": []
          }
        ],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/v3/businesses/north-india-restaurant-san-francisco",
              "headers": {
                "Authorization": "Bearer"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "/businesses/{id}",
            "x-testDescription": ""
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/businesses/{id}/reviews": {
      "get": {
        "description": "",
        "summary": "/businesses/{id}/reviews",
        "operationId": "/businesses/{id}/reviews",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string",
            "default": "north-india-restaurant-san-francisco"
          },
          {
            "$ref": "#/parameters/Authorization"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "auth": []
          }
        ],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/v3/businesses/north-india-restaurant-san-francisco/reviews",
              "headers": {
                "Authorization": "Bearer"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "/businesses/{id}/reviews",
            "x-testDescription": ""
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/autocomplete": {
      "get": {
        "description": "",
        "summary": "/autocomplete",
        "operationId": "/autocomplete",
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "required": true,
            "type": "string",
            "description": ""
          },
          {
            "$ref": "#/parameters/latitude"
          },
          {
            "$ref": "#/parameters/longitude"
          },
          {
            "$ref": "#/parameters/Authorization"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "auth": []
          }
        ],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/v3/autocomplete?text=del&latitude=37.786942&longitude=-122.399643",
              "headers": {
                "Authorization": "Bearer"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "/autocomplete",
            "x-testDescription": ""
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/businesses/search/phone": {
      "get": {
        "description": "",
        "summary": "/businesses/search/phone",
        "operationId": "/businesses/search/phone",
        "parameters": [
          {
            "name": "phone",
            "in": "query",
            "required": true,
            "type": "number",
            "format": "double",
            "description": ""
          },
          {
            "$ref": "#/parameters/Authorization"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "auth": []
          }
        ],
        "x-unitTests": [],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    },
    "/transactions/delivery/search": {
      "get": {
        "description": "",
        "summary": "/transactions/search",
        "operationId": "/transactions/search",
        "parameters": [
          {
            "$ref": "#/parameters/latitude"
          },
          {
            "$ref": "#/parameters/longitude"
          },
          {
            "$ref": "#/parameters/Authorization"
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "auth": []
          }
        ],
        "x-unitTests": [
          {
            "request": {
              "method": "GET",
              "uri": "/v3/transactions/delivery/search?latitude=37.786882&longitude=-122.399972",
              "headers": {
                "Authorization": "Bearer"
              }
            },
            "expectedResponse": {
              "x-allowExtraHeaders": true,
              "x-bodyMatchMode": "NONE",
              "x-arrayOrderedMatching": false,
              "x-arrayCheckCount": false,
              "x-matchResponseSchema": true,
              "headers": {}
            },
            "x-testShouldPass": true,
            "x-testEnabled": true,
            "x-testName": "/transactions/search",
            "x-testDescription": ""
          }
        ],
        "x-operation-settings": {
          "CollectParameters": false,
          "AllowDynamicQueryParameters": false,
          "AllowDynamicFormParameters": false,
          "IsMultiContentStreaming": false
        }
      }
    }
  },
  "parameters": {
    "latitude": {
      "name": "latitude",
      "in": "query",
      "required": true,
      "type": "number",
      "format": "double"
    },
    "longitude": {
      "name": "longitude",
      "in": "query",
      "required": true,
      "type": "number",
      "format": "double"
    },
    "Authorization": {
      "name": "Authorization",
      "in": "header",
      "required": true,
      "type": "string"
    }
  }
}

以上是关于json Yelp的-的OpenAPI的主要内容,如果未能解决你的问题,请参考以下文章

Alamofire 获取请求和 JSON 响应(Yelp API)

PHP 从YELP API解析JSON

通过python逐行读取yelp数据集

重命名 OpenAPI 的参考生成的 swagger.json

json OpenAPI的-spec.json

如何从 OpenAPI 3.0 yaml 文件生成 JSON 示例?