openapi: 3.0.1
info:
  title: Aviation Data Hub API - Airport Vertical
  description: Aviation Data Hub acts as a central data repository for all functions, which affect the efficient functioning of an airport. Data can be ingested from various sources via standardized interfaces. The way of getting data out of it is similar; there are standardized REST and MQTT interfaces to fetch the data. The data structure is based on industry standards such as IATA's AIDM and ACI's ACRIS combined with decades of Siemens Logistics industry knowledge.
  contact:
    name: Siemens Logistics GmbH
    url: https://www.siemens-logistics.com
    email: adh-devportal@siemens-logistics.com
  license:
    name: Property of Siemens Logistics GmbH
  version: 20.2.0
tags:
  - name: Airport Store
    externalDocs:
      description: The airport store contains methods to access and insert or modify airport data.
      url: https://devportal.aviationdatahub.siemens.cloud/en/airport-vertical/overview
paths:
  /airports:
    get:
      tags:
        - Airport Store
      summary: Query all airports.
      description: Lookup all airports.
      operationId: queryAllAirports
      responses:
        "200":
          description: default response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Airport"
        "400":
          description: "Bad Request: e.g. invalid parameter."
          content:
            application/json: {}
        "401":
          description: "Unauthorized: please login first."
        "403":
          description: "Forbidden: not allowed to perform this request."
    post:
      tags:
        - Airport Store
      summary: Insert (or overwrite) an airport.
      description: New data is processed asynchronously and may need some time to be updated.
      operationId: postAirport
      requestBody:
        description: An Airport JSON structure.
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Airport"
        required: true
      responses:
        "200":
          description: default response
        "400":
          description: "Bad Request: e.g. invalid parameter."
          content:
            application/json: {}
        "401":
          description: "Unauthorized: please login first."
        "403":
          description: "Forbidden: not allowed to perform this request."
  /airports/{iata-code}:
    get:
      tags:
        - Airport Store
      summary: Query airports by IATA code.
      description: Lookup a specific airport.
      operationId: getAirportREST
      parameters:
        - name: iata-code
          in: path
          description: The airport IATA code.
          required: true
          schema:
            type: string
      responses:
        "200":
          description: "Ok: Default response."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Airport"
        "400":
          description: "Bad Request: e.g. invalid parameter."
          content:
            application/json: {}
        "401":
          description: "Unauthorized: please login first."
        "403":
          description: "Forbidden: not allowed to perform this request."
        "404":
          description: "Not Found: airport with given iata-code not found."
components:
  schemas:
    Airport:
      required:
        - country
        - geo-coordinate
        - iata-code
        - icao-code
        - name
        - time-zone
      type: object
      properties:
        name:
          minLength: 1
          type: string
          description: Name of the airport.
          example: Dubai International Airport
        iata-code:
          maxLength: 4
          minLength: 3
          type: string
          description: "3-digit airport IATA code. All uppercase. If no IATA code exists enter the 4-digit ICAO code here. "
          example: DXB
        icao-code:
          maxLength: 4
          minLength: 4
          type: string
          description: 4-digit airport ICAO code. All uppercase.
          example: OMDB
        country:
          minLength: 1
          type: string
          description: Country ISO Code.
          example: VAE
        time-zone:
          type: string
          description: Time zone identifier.
          example: Asia/Dubai
        geo-coordinate:
          $ref: "#/components/schemas/GeoCoordinate"
      description: Description of an airport.
    GeoCoordinate:
      required:
        - lat
        - lon
      type: object
      properties:
        lat:
          type: number
          description: Latitude in degrees, valid range is -90.0 to 90.0.
          format: double
        lon:
          type: number
          description: Longitude in degrees, valid range is -180.0 to 180.0.
          format: double
      description: Geo coordinated defined by latitude and longitude, compatible with ElasticSearch GeoPoint type.
