{
  "openapi": "3.0.3",
  "info": {
    "title": "Acme Coffee Store API",
    "version": "1.0.0",
    "description": "Demo API protected by Cloudflare API Shield. All data is fictional."
  },
  "servers": [{ "url": "https://api.aldo.cloud" }],
  "paths": {
    "/api/v1/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "List products",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "enum": ["coffee", "tea", "gear"] }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "minimum": 1, "maximum": 50 }
          }
        ],
        "responses": { "200": { "description": "Product list" } }
      }
    },
    "/api/v1/products/{productId}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Get one product",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": { "type": "integer", "minimum": 1, "maximum": 9999 }
          }
        ],
        "responses": { "200": { "description": "Product" } }
      }
    },
    "/api/v1/orders": {
      "post": {
        "operationId": "createOrder",
        "summary": "Place an order",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/OrderRequest" }
            }
          }
        },
        "responses": { "201": { "description": "Order created" } }
      }
    },
    "/api/v1/orders/{orderId}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Get an order",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "format": "uuid" }
          }
        ],
        "responses": { "200": { "description": "Order" } }
      }
    },
    "/api/v1/login": {
      "post": {
        "operationId": "login",
        "summary": "Log in",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/LoginRequest" }
            }
          }
        },
        "responses": {
          "200": { "description": "Logged in" },
          "401": { "description": "Invalid credentials" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "OrderRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["productId", "quantity", "email"],
        "properties": {
          "productId": { "type": "integer", "minimum": 1, "maximum": 9999 },
          "quantity": { "type": "integer", "minimum": 1, "maximum": 10 },
          "email": { "type": "string", "format": "email", "maxLength": 100 }
        }
      },
      "LoginRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["username", "password"],
        "properties": {
          "username": { "type": "string", "pattern": "^[A-Za-z0-9_]{3,32}$" },
          "password": { "type": "string", "minLength": 8, "maxLength": 64 }
        }
      }
    }
  }
}
