Commit c429b952 authored by Grant's avatar Grant
Browse files

add openapi spec

parent fe23a459
Loading
Loading
Loading
Loading

openapi.yml

0 → 100644
+71 −0
Original line number Diff line number Diff line
openapi: 3.1.1

info:
  title: matrix-discord-bridge
  version: 0.0.0

servers: []

components:
  securitySchemes:
    admin:
      type: http
      scheme: bearer

paths:
  /api/admin/bridged:
    post:
      operationId: create-bridge
      summary: create bridge
      description: |
        this endpoint will also check permissions
      security:
        - admin: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - matrix_room_id
                - discord_guild_id
                - discord_channel_id
              properties:
                matrix_room_id:
                  type: string
                  format: "!room_id:home.server"
                discord_guild_id:
                  type: string
                discord_channel_id:
                  type: string
      responses:
        201:
          description: Created
        400:
          description: Failure
  /api/admin/bridged/{id}:
    parameters:
      - name: id
        in: path
        schema:
          type: string
    get:
      operationId: get-bridge
      summary: get bridge
      security:
        - admin: []
      responses:
        200:
          description: bridge exists
        404:
          description: bridge does not exist
    delete:
      operationId: delete-bridge
      summary: delete bridge
      security:
        - admin: []
      responses:
        200:
          description: success
        404:
          description: bridge does not exist