{
  "openapi": "3.1.0",
  "info": {
    "version": "1.0.0",
    "title": "Todo API",
    "description": "A simple task management API that lets you create, read, update, and delete todo items. Use this API to build productivity apps, task trackers, or integrate task management into your existing workflows.\n\n## Getting Started\n\nAll endpoints accept and return JSON. To create your first todo, send a `POST` request to `/todos` with a title and userId.\n\n## Authentication\n\nThis sample API does not require authentication. Add [API key authentication](https://zuplo.com/docs/policies/api-key-inbound) or any other policy via your Zuplo gateway configuration.",
    "contact": {
      "name": "API Support",
      "url": "https://zuplo.com/docs",
      "email": "support@zuplo.com"
    }
  },
  "paths": {
    "/decisions": {
      "x-zuplo-path": {
        "pathMode": "open-api"
      },
      "post": {
        "summary": "Create a New  Decision",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(DECISION_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "create-decision-eff636c1"
      }
    },
    "/decisions/{decisionId}": {
      "x-zuplo-path": {
        "pathMode": "open-api"
      },
      "get": {
        "summary": "Get a Decision",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(DECISION_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "get-decision-d8fa38b8"
      }
    },
    "/policies/{policyId}": {
      "x-zuplo-path": {
        "pathMode": "open-api"
      },
      "get": {
        "summary": "Get a Policy",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(POLICY_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "get-policy-8f612bc7"
      },
      "put": {
        "summary": "Update a Policy",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(POLICY_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "update-policy-9f998992"
      },
      "delete": {
        "summary": "Delete a Policy",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(POLICY_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "delete-policy-b1e20414"
      }
    },
    "/policies": {
      "x-zuplo-path": {
        "pathMode": "open-api"
      },
      "post": {
        "summary": "Create a New Policy",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(POLICY_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "new-policy-a0c81039"
      },
      "get": {
        "summary": "List Policies",
        "description": "",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "awsLambdaHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "functionName": "$env(POLICY_LAMBDA_NAME)",
              "region": "eu-west-1",
              "accessKeyId": "$env(AWS_ACCESS_ID)",
              "secretAccessKey": "$env(AWS_SECRET_KEY)"
            }
          },
          "policies": {
            "inbound": [
              "api-key-inbound",
              "set-request-headers"
            ]
          }
        },
        "operationId": "list-policies-46a4fe04"
      }
    }
  },
  "tags": [
    {
      "name": "Todo",
      "description": "Endpoints for managing todo items including creating, listing, updating, and deleting tasks."
    }
  ],
  "components": {
    "schemas": {
      "Todo": {
        "description": "A complete todo item as returned by the API, including its system-assigned ID.",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The todo ID"
          },
          "title": {
            "type": "string",
            "description": "The todo title"
          },
          "completed": {
            "type": "boolean",
            "description": "Whether the todo is completed"
          },
          "userId": {
            "type": "integer",
            "description": "The user ID who owns the todo"
          }
        },
        "required": [
          "id",
          "title",
          "completed",
          "userId"
        ]
      },
      "CreateTodo": {
        "description": "The request body for creating a new todo. Only a title and userId are required.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "The todo title"
          },
          "completed": {
            "type": "boolean",
            "description": "Whether the todo is completed",
            "default": false
          },
          "userId": {
            "type": "integer",
            "description": "The user ID who owns the todo"
          }
        },
        "required": [
          "title",
          "userId"
        ]
      },
      "UpdateTodo": {
        "description": "The request body for updating a todo. All fields are optional so you can patch individual properties.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "The todo title"
          },
          "completed": {
            "type": "boolean",
            "description": "Whether the todo is completed"
          },
          "userId": {
            "type": "integer",
            "description": "The user ID who owns the todo"
          }
        }
      }
    }
  }
}