openapi: 3.0.1
info:
  title: Issues
  version: 2.10.0
  description: REST API for issues management.
  contact:
    name: Tradevest GmbH
    url: https://tradevest.ai
    email: hello@tradevest.ai
servers:
  - url: https://tvda-api.platform-test.tradevest.ai
    description: Test
security:
  - Bearer: []
tags:
  - name: Issues
    description: Issues domain
paths:
  /issues:
    post:
      summary: Create Issue
      operationId: create-issue
      x-operation-group: issues-command
      x-required-permissions: rs/issues/write
      description: Create issue in JIRA
      tags:
        - Issues
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateIssueResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IssueData'
components:
  schemas:
    CreateIssueResult:
      title: CreateIssueResult
      type: object
      properties:
        id:
          type: string
          description: Issue identifier
          readOnly: true
      required:
        - id
    IssueData:
      title: IssueData
      type: object
      properties:
        summary:
          type: string
        description:
          type: string
        type:
          type: string
        channel:
          type: string
        category:
          type: string
      required:
        - summary
        - type
        - channel
        - category
    ErrorDetailsExplanation:
      title: ErrorDetailsExplanation
      type: object
      properties:
        code:
          type: string
          maxLength: 255
        parameter:
          type: string
        message:
          type: string
      required:
        - code
        - message
    ErrorDetails:
      title: ErrorDetails
      type: object
      properties:
        field:
          type: string
          maxLength: 255
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetailsExplanation'
      required:
        - field
    ErrorMessage:
      title: ErrorMessage
      type: object
      properties:
        message:
          type: string
        responseType:
          type: string
        validationString:
          minLength: 1
          type: string
        requestId:
          type: string
        errorCode:
          type: string
          maxLength: 255
        errorDetails:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetails'
      required:
        - message
        - responseType
        - requestId
  securitySchemes:
    Bearer:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth2/token
          scopes: {}
x-tagGroups:
  - name: Issues
    tags:
      - Issues
