{
  "info": {
    "title": "Coffee Brewing API",
    "description": "API for brewing and enjoying the perfect cup of coffee ☕",
    "version": "1.0.0"
  },
  "servers": [
    { "url": "https://api.coffee.local/v1" }
  ],
  "paths": {
    "/coffee": {
      "post": {
        "summary": "Unified coffee operations",
        "description": "Perform any coffee operation: list beans, grind, brew, serve.",
        "operationId": "coffeeAction",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["action"],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": ["listBeans", "grindBeans", "brewCoffee", "serveCoffee"]
                  },
                  "beanId": { "type": "string", "example": "ethiopian-yirgacheffe" },
                  "grindSize": { "type": "string", "enum": ["coarse", "medium", "fine"], "example": "medium" },
                  "waterTemp": { "type": "integer", "example": 93, "description": "°C" },
                  "brewTime": { "type": "integer", "example": 240, "description": "seconds" },
                  "method": { "type": "string", "enum": ["espresso", "pour-over", "french-press", "cold-brew"], "example": "pour-over" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result of coffee operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "beans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "string" },
                          "name": { "type": "string" },
                          "flavorProfile": { "type": "string" }
                        }
                      }
                    },
                    "status": { "type": "string" },
                    "aroma": { "type": "string" },
                    "strength": { "type": "string" },
                    "temperature": { "type": "number" },
                    "message": { "type": "string" },
                    "servedAt": { "type": "string", "format": "date-time" },
                    "quote": { "type": "string" },
                    "method": { "type": "string" },
                    "flavorProfile": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

12

21

21