openapi: 3.0.0
info:
  title: development API
  description: Set of endpoints to development tasks  
  contact:
    email: auradev@tid.es
tags:
  - name: development
    description: Management of development tasks
servers:
  - url: 'http://localhost:8989'
    description: Local server
  - url: 'https://svc-ap-current.auracognitive.com'
    description: ap-current
paths:
  /dev/behavior-manager/commands:
    post:
      parameters:
        - name: correlator
          in: header
          description: Unique identifier of a request to be used as correlator in all systems
          schema:
            type: string
            format: uuid
      tags:
        - development  
      description: Send a command to behavior manager
      operationId: behaviorManagerCommand
      x-router-controller: routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/behaviorManagerCommandRequest'
      responses:
        '200':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/behaviorManagerCommandResponse'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:    
    InternalError:
      description: Incoming HTTP request produces an internal error
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    InvalidRequest:
      description: Incoming HTTP request format is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    NotFound:
      description: Incoming HTTP request is not found
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
  schemas:
    AuraError:
      type: object
      description: Error response
      properties:
        code:
          type: string
          description: Unique id of the error
        message:
          type: string
          description: Specific and descriptive text of the error
        errors:
          description: With validation error. Swagger error information
          type: array
          items:
            type: object
    behaviorManagerCommandRequest:
      type: object
      description: Request to send a command to behavior manager
      properties:
        command:
          type: string
          description: Command to send to behavior manager
      required:
        - command
    behaviorManagerCommandResponse:
      type: object
      description: Response to send a command to behavior manager
      properties:
        command:
          type: string
          description: Command to send to behavior manager
        correlator:
          type: string
          description: Unique identifier of a request to be used as correlator in all systems
        result:
          oneOf:
            - type: string
            - type: object
          description: Result of the command
      required:
        - command