openapi: "3.1.0"
info:
  title: "Todo API"
  version: "1.0.0"
  description: "A tiny demo API written in OMG. On Docusaurus build the plugin compiles every

    `.omg.md` file below this one into OpenAPI 3.1 and writes it to

    `static/api/todo.yaml`, so it's served at `/api/todo.yaml` at runtime.


    Point your favourite OpenAPI renderer at that URL."
paths:
  /todos:
    post:
      operationId: "create-todo"
      summary: "Create a todo"
      tags:
        - "Todos"
      responses:
        "201":
          description: "Created"
          content:
            application/json:
              schema:
                type: "object"
                properties:
                  id:
                    type: "string"
                    format: "uuid"
                  title:
                    type: "string"
                  completed:
                    type: "boolean"
                required:
                  - "id"
                  - "title"
                  - "completed"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
              properties:
                title:
                  minLength: 1
                  maxLength: 200
                  type: "string"
              required:
                - "title"
    get:
      operationId: "list-todos"
      summary: "List todos"
      description: "Returns all todos, optionally filtered by completion status."
      tags:
        - "Todos"
      responses:
        "200":
          description: "Success"
          content:
            application/json:
              schema:
                type: "array"
                items:
                  type: "object"
                  properties:
                    id:
                      type: "string"
                      format: "uuid"
                    title:
                      type: "string"
                    completed:
                      type: "boolean"
                  required:
                    - "id"
                    - "title"
                    - "completed"
      parameters:
        - name: "completed"
          in: "query"
          required: false
          schema:
            type: "boolean"
        - name: "limit"
          in: "query"
          required: false
          schema:
            minimum: 1
            maximum: 100
            type: "integer"
components:
  schemas: {}
servers:
  - url: "https://api.example.com/v1"
