openapi: 3.1.0
info:
  title: api-incident-mapper
  contact: { }
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "2.0"
servers:
  - url: http://localhost:53818
    description: Generated server url
tags:
  - name: Incidents
    description: incident operations
  - name: Jobs
    description: Jobs resource
paths:
  /{municipalityId}/jobs/synchronizer:
    post:
      tags:
        - Jobs
      summary: Runs synchronizer job.
      description: Runs synchonizer job.
      operationId: synchronizer
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/incidents:
    post:
      tags:
        - Incidents
      summary: Post new or updated incidents
      operationId: postIncident
      parameters:
        - name: municipalityId
          in: path
          description: Municipality id
          required: true
          schema:
            type: string
          example: 2281
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IncidentRequest"
        required: true
      responses:
        "202":
          description: Successful Operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/Problem"
                  - $ref: "#/components/schemas/ConstraintViolationProblem"
        "401":
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /api-docs:
    get:
      tags:
        - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
components:
  schemas:
    ConstraintViolationProblem:
      type: object
      properties:
        causeAsProblem:
          $ref: "#/components/schemas/ThrowableProblem"
        detail:
          type: string
        instance:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            $ref: "#/components/schemas/Violation"
    IncidentRequest:
      type: object
      description: Incident request model
      properties:
        incidentKey:
          type: string
          description: The incident key
          minLength: 1
          examples:
            - INCIDENT-12345
      required:
        - incidentKey
    Problem:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
    ThrowableProblem:
      type: object
      properties:
        causeAsProblem: { }
        detail:
          type: string
        instance:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
    Violation:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
  securitySchemes: { }
