json Portcall + API

Posted

tags:

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

{
  "swagger": "2.0",
  "info": {
    "title": "Portcall+ API (sandbox)",
    "version": "1.0",
    "description": "PortPlus API"
  },
  "host": "api-sb.nxtport.eu",
  "basePath": "/PortCallPlus/v1",
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "apiKeyHeader": {
      "type": "apiKey",
      "name": "Ocp-Apim-Subscription-Key",
      "in": "header"
    },
    "apiKeyQuery": {
      "type": "apiKey",
      "name": "Subscription-Key",
      "in": "query"
    }
  },
  "security": [
    {
      "apiKeyHeader": []
    },
    {
      "apiKeyQuery": []
    }
  ],
  "paths": {
    "/vessels/expected": {
      "get": {
        "description": "Get all the expected vessels of BEANR and BEZEE",
        "operationId": "Vessels_Expected",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/VoyageDtoArray"
            }
          },
          "400": {
            "description": "BadRequest",
            "schema": {
              "$ref": "#/definitions/ErrorDto"
            }
          }
        },
        "produces": [
          "application/json",
          "text/json",
          "application/xml",
          "text/xml"
        ]
      }
    },
    "/vessels/in-port": {
      "get": {
        "description": "Get all the in-port vessels of BEANR and BEZEE",
        "operationId": "Vessels_InPort",
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/VoyageDtoArray"
            }
          },
          "400": {
            "description": "BadRequest",
            "schema": {
              "$ref": "#/definitions/ErrorDto"
            }
          }
        },
        "produces": [
          "application/json",
          "text/json",
          "application/xml",
          "text/xml"
        ]
      }
    }
  },
  "definitions": {
    "AgentDto": {
      "properties": {
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "ErrorDto": {
      "properties": {
        "error": {
          "type": "string"
        },
        "identifier": {
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object"
    },
    "LastCheckedDto": {
      "properties": {
        "lastChecked": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "LocationDto": {
      "properties": {
        "actualTime": {
          "type": "string"
        },
        "anchored": {
          "type": "boolean"
        },
        "code": {
          "type": "string"
        },
        "estimatedTime": {
          "type": "string"
        },
        "locode": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "PortDto": {
      "properties": {
        "locode": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "TimeDto": {
      "properties": {
        "actualTime": {
          "type": "string"
        },
        "estimatedTime": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "VesselDto": {
      "properties": {
        "callsign": {
          "type": "string"
        },
        "flag": {
          "type": "string"
        },
        "gbr": {
          "format": "double",
          "type": "number"
        },
        "imoNumber": {
          "type": "string"
        },
        "loa": {
          "format": "double",
          "type": "number"
        },
        "mmsiNumber": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "tonnage": {
          "format": "double",
          "type": "number"
        },
        "type": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "VoyageDto": {
      "properties": {
        "agent": {
          "$ref": "#/definitions/AgentDto"
        },
        "currentPort": {
          "$ref": "#/definitions/PortDto"
        },
        "destinationPort": {
          "$ref": "#/definitions/PortDto"
        },
        "fromLocation": {
          "$ref": "#/definitions/LocationDto"
        },
        "nextPort": {
          "$ref": "#/definitions/PortDto"
        },
        "originPort": {
          "$ref": "#/definitions/PortDto"
        },
        "passages": {
          "items": {
            "$ref": "#/definitions/LocationDto"
          },
          "type": "array"
        },
        "previousPort": {
          "$ref": "#/definitions/PortDto"
        },
        "stayBegin": {
          "$ref": "#/definitions/TimeDto"
        },
        "stayEnd": {
          "$ref": "#/definitions/TimeDto"
        },
        "stayNumber": {
          "type": "string"
        },
        "toLocation": {
          "$ref": "#/definitions/LocationDto"
        },
        "vessel": {
          "$ref": "#/definitions/VesselDto"
        },
        "voyageNumber": {
          "type": "string"
        },
        "voyageType": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "VoyageDtoArray": {
      "items": {
        "$ref": "#/definitions/VoyageDto"
      },
      "type": "array"
    }
  }
}

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

JSON:带有 django-rest-framework-json-api 和 JWT 的 API

Ktor:如何序列化/反序列化 JSON-API (vnd.api+json)

使用请求将 json 输入传递给 API

使用 SQLite API 将 API 输出 (JSON) 插入 SQLite

Nuxt serverMiddleware 从 API 获取 json

json JSON API - 示例错误响应