swagger: "2.0"
info:
  title: RESTful API Gateway
  description: This is the documentation for the RESTful API gateway.
  version: "1.0.0"

consumes:
  - "application/json"
produces:
  - "application/json"

basePath: "/api"

# Paths supported by the server application
paths:
  /debug:
    post:
      operationId: "rest.debug.echo"
      tags:
        - "Echo"
      summary: "Echo function for debugging purposes"
      description: "Echoes the input back to the caller."
      parameters:
        - in: body
          name: "Object"
          required: true
          schema:
            type: object
      responses:
        200:
          description: "Successful echo of request data"
  
  /trace:
    post:
        operationId: "rest.blockchain_trace.receive"
        tags:
          - "Blockchain Trace"
        summary: "Add a new blockchain trace to SMART"
        description: "Receives a new blockchain trace to store in SMART."
        parameters:
          - in: body 
            name: "BlockchainTrace"
            description: "The trace to be added"
            required: true
            schema:
              $ref: "#/definitions/BlockchainTrace"
        responses:
          201:
            description: "Successfully added"
          400:
            description: "Invalid input"

definitions:
  BlockchainTrace:
    type: "object"
    properties:
      TransactionId:
        type: string
        format: uuid
      Timestamp:
        type: "string"
        format: "date-time"
      ApplicationType:
        type: "string"
      TransactionFrom:
        type: "string"
        format: "uuid"
      TransactionFromLatLng:
        type: "string"
      TransactionTo:
        type: "string"
        format: "uuid"
      TransactionToLatLng:
        type: "string"
      TransferredAsset:
        type: "string"
      ResourceIds:
        type: "string"
      ResourceMd5:
        type: "string"
      ResourceState:
        type: "string"
      Metadata:
        type: "string"
    