openapi: 3.0.1
info:
  title: Gate API for Platform
  description: This API is provided by the gate for platform applications
  version: 0.3.0

components:
  parameters:
    RequestIdHeader:
      in: header
      name: X-Request-ID
      description: Correlation identifier for the request as defined by the client (required for traceability)
      schema:
        type: string
        format: uuid
      required: true
  schemas:
    ProblemDetail:
      type: object
      xml:
        name: problem
        namespace: "urn:ietf:rfc:7807"
      properties:
        type:
          type: string
          description: A URI reference that identifies the problem type.
          format: uri
          example: about:blank
        status:
          type: integer
          description: The HTTP status code generated by the origin server for this occurrence of the problem.
          format: int32
          example: 500
        title:
          type: string
          description: A short, human-readable summary of the problem type.
          example: Internal Server Error
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the problem.
        instance:
          type: string
          description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
          format: uri
          example: /api
      required:
        - type
        - status
        - title
        - instance
paths:

  /v0/whoami:
    parameters:
      - $ref: "#/components/parameters/RequestIdHeader"
    get:
      operationId: "getWhoami"
      responses:
        "200":
          description: Information of authenticated client
          content:
            application/xml:
              schema:
                type: object
                xml:
                  name: whoamiResponse
                required: [ appId, role ]
                properties:
                  appId:
                    type: string
                  role:
                    type: string

  /v0/consignments/{datasetId}:
    parameters:
      - $ref: "#/components/parameters/RequestIdHeader"
      - in: path
        name: datasetId
        description: DatasetId for consignment identifiers. Must be in UUIDv4 format.
        schema:
          type: string
        required: true
    put:
      operationId: "putConsignmentIdentifiers"
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: object
              description: consignment element of type SupplyChainConsignment as defined by schema consignment-identifiers.xsd
      responses:
        "200":
          description: Consignment identifiers updated successfully
        "201":
          description: Consignment identifiers created successfully
        default:
          description: Unexpected error
          content:
            application/problem+xml:
              schema:
                $ref: "#/components/schemas/ProblemDetail"
