{
  "openapi": "3.1.0",
  "info": {
    "title": "Kräftskiva public songbook",
    "version": "1.0.0",
    "description": "Anonymous, read-only public song search and retrieval."
  },
  "servers": [
    {
      "url": "https://www.kraftskiva.org"
    }
  ],
  "security": [],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchSongs",
        "summary": "Search songs",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "fi",
                "sv"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching songs with total count and canonical URLs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid search parameters"
          }
        }
      }
    },
    "/api/songs.json": {
      "get": {
        "operationId": "getCatalog",
        "responses": {
          "200": {
            "description": "Complete public songbook",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/songs/{id}.json": {
      "get": {
        "operationId": "getSong",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Song with lyrics and sources",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Unknown song"
          }
        }
      }
    }
  }
}
