openapi: 3.1.0
info:
  title: html-share API
  description: API for versioned and collaborative HTML sharing.
  version: 1.0.0
servers:
  - url: ${baseUrl}/api/v1
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
security:
  - bearerAuth: []
paths:
  /shares:
    get:
      summary: List shares
      responses:
        '200':
          description: A list of shares
    post:
      summary: Create a share
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [title, html]
              properties:
                title: { type: string }
                html: { type: string }
                description: { type: string }
                password: { type: string }
                expires_at: { type: string, format: date-time }
      responses:
        '201':
          description: Created
  /shares/{slug}:
    get:
      summary: Get share info
    patch:
      summary: Update share settings
    delete:
      summary: Delete share
  /shares/{slug}/versions:
    get:
      summary: List versions
    post:
      summary: Create new version
