openapi: 3.2.0
info:
  title: Powerduck HTTP reference example
  version: 1.0.0
  description: 'Official example, not a hosted API. Local services must be started separately.'
servers:
  - url: 'http://127.0.0.1:8080'
tags:
  - name: http
paths:
  /messages:
    post:
      operationId: create_message
      summary: create message
      description: >-
        Official Powerduck example definition. Replace the example endpoint with your own service
        before sending.
      tags:
        - http
      parameters:
        - name: X-Request-ID
          in: header
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                id:
                  type: string
            example:
              message: Hello
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                  id:
                    type: string
              example:
                message: Hello from Powerduck
                id: example-1
  /cache:
    additionalOperations:
      PURGE:
        operationId: purge_cache
        summary: purge cache
        description: >-
          Official Powerduck example definition. Replace the example endpoint with your own service
          before sending.
        tags:
          - http
        responses:
          '200':
            description: Successful response
            content:
              application/json:
                schema:
                  type: object
                  required:
                    - message
                  properties:
                    message:
                      type: string
                    id:
                      type: string
                example:
                  message: Hello from Powerduck
                  id: example-1
components:
  schemas:
    Message:
      type: object
      required:
        - message
      properties:
        message:
          type: string
        id:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
