{
  "openapi": "3.1.0",
  "info": {
    "title": "Blas Celtic Languages API",
    "description": "Public tool endpoints for querying verified Celtic language vocabulary, consonant mutations, verb conjugations, and multi-source dictionary comparisons across Irish, Welsh, Scottish Gaelic, Breton, Cornish, and Manx.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://blasapp.com"
    }
  ],
  "paths": {
    "/api/tools/v1/dictionary": {
      "get": {
        "operationId": "searchDictionary",
        "summary": "Search Celtic dictionaries and mutation rules",
        "description": "Searches Blas verified vocabulary and conjugations for headwords, inflected forms, or English meanings across Celtic languages.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "The search word or phrase (native Celtic or English)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "Target language: irish, welsh, scots-gaelic, breton, cornish, or manx (omitted searches all)",
            "schema": {
              "type": "string",
              "enum": ["irish", "welsh", "scots-gaelic", "breton", "cornish", "manx"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results including verified headwords, definitions, grammatical metadata, and mutation breakdown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/v1/compare": {
      "get": {
        "operationId": "compareDictionaries",
        "summary": "Compare across authoritative Celtic dictionary sources",
        "description": "Retrieves verified entry details alongside cross-references and deep links to national academic and corpus dictionaries (Teanglann, Foclóir, GPC, LearnGaelic, Devri, etc.).",
        "parameters": [
          {
            "name": "word",
            "in": "query",
            "required": true,
            "description": "Headword to compare",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": true,
            "description": "Language code",
            "schema": {
              "type": "string",
              "enum": ["irish", "welsh", "scots-gaelic", "breton", "cornish", "manx"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Multi-dictionary comparison payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparisonResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SearchResponse": {
        "type": "object",
        "properties": {
          "query": { "type": "string" },
          "language": { "type": "string" },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "native": { "type": "string" },
                "english": { "type": "string" },
                "partOfSpeech": { "type": "string" },
                "gender": { "type": "string" },
                "ipa": { "type": "string" },
                "language": { "type": "string" },
                "url": { "type": "string" },
                "mutation": {
                  "type": "object",
                  "properties": {
                    "mutationType": { "type": "string" },
                    "nativeName": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      },
      "ComparisonResponse": {
        "type": "object",
        "properties": {
          "headword": { "type": "string" },
          "language": { "type": "string" },
          "blasVerified": { "type": "object" },
          "authorities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "role": { "type": "string" },
                "url": { "type": "string" }
              }
            }
          },
          "discrepancies": {
            "type": "array",
            "items": { "type": "string" }
          }
        }
      }
    }
  }
}
