{
  "openapi": "3.0.1",
  "info": {
    "title": "Drow Translatascan API",
    "description": "Translates text between Common and Drow.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://drowtranslatascan.azurewebsites.net/api"
    }
  ],
  "paths": {
    "/Home": {
      "get": {
        "tags": [
          "ui"
        ],
        "summary": "Translator web UI",
        "operationId": "Home",
        "responses": {
          "200": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/Translate": {
      "get": {
        "tags": [
          "translate"
        ],
        "summary": "Translate text (plain text)",
        "operationId": "Translate",
        "parameters": [
          {
            "name": "text",
            "in": "query",
            "description": "Text to translate",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Target language: 'Drow' or 'Common'",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ver",
            "in": "query",
            "description": "If present, returns version greeting",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Translated text",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/TranslateJson": {
      "post": {
        "tags": [
          "translate"
        ],
        "summary": "Translate text (JSON)",
        "operationId": "TranslateJson",
        "requestBody": {
          "description": "Translation request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/translateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Translation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/translateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "errorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "translateRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "lang": {
            "type": "string"
          }
        }
      },
      "translateResponse": {
        "type": "object",
        "properties": {
          "translation": {
            "type": "string"
          },
          "originalText": {
            "type": "string"
          },
          "targetLanguage": {
            "type": "string"
          }
        }
      }
    }
  }
}