{
  "openapi": "3.1.0",
  "info": {
    "title": "Phck API",
    "version": "1.0.0"
  },
  "x-voltro-environment": "production",
  "paths": {
    "/": {
      "get": {
        "summary": "API status and endpoints",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "version": {
                      "type": "string"
                    },
                    "docs": {
                      "type": "string"
                    },
                    "openapi": {
                      "type": "string"
                    },
                    "health": {
                      "type": "string"
                    },
                    "endpoints": {
                      "type": "object",
                      "properties": {
                        "listProducts": {
                          "type": "string"
                        },
                        "getProduct": {
                          "type": "string"
                        },
                        "createProduct": {
                          "type": "string"
                        },
                        "updateProduct": {
                          "type": "string"
                        },
                        "deleteProduct": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "listProducts",
                        "getProduct",
                        "createProduct",
                        "updateProduct",
                        "deleteProduct"
                      ],
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "service",
                    "status",
                    "version",
                    "docs",
                    "openapi",
                    "health",
                    "endpoints"
                  ],
                  "additionalProperties": true
                },
                "example": {
                  "service": "string",
                  "status": "ok",
                  "version": "string",
                  "docs": "string",
                  "openapi": "string",
                  "health": "string",
                  "endpoints": {
                    "listProducts": "string",
                    "getProduct": "string",
                    "createProduct": "string",
                    "updateProduct": "string",
                    "deleteProduct": "string"
                  }
                },
                "x-voltro-example": "derived"
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products": {
      "get": {
        "summary": "List products",
        "description": "Cursor-paginated. Pass the response `nextCursor` back as `cursor` for the next page.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "priceCents": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "priceCents",
                          "createdAt"
                        ],
                        "additionalProperties": true
                      }
                    },
                    "nextCursor": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "additionalProperties": true
                },
                "example": {
                  "data": [
                    {
                      "id": "string",
                      "name": "string",
                      "priceCents": 1,
                      "createdAt": "string"
                    }
                  ],
                  "nextCursor": "string"
                },
                "x-voltro-example": "derived"
              }
            }
          },
          "400": {
            "description": "Invalid request — the input failed schema decode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a product",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "priceCents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "name",
                  "priceCents"
                ],
                "additionalProperties": true
              },
              "example": {
                "name": "string",
                "priceCents": 0
              },
              "x-voltro-example": "derived"
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "priceCents": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "priceCents",
                    "createdAt"
                  ],
                  "additionalProperties": true
                },
                "example": {
                  "id": "string",
                  "name": "string",
                  "priceCents": 1,
                  "createdAt": "string"
                },
                "x-voltro-example": "derived"
              }
            }
          },
          "400": {
            "description": "Invalid request — the input failed schema decode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{id}": {
      "get": {
        "summary": "Get a product by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "priceCents": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "priceCents",
                    "createdAt"
                  ],
                  "additionalProperties": true
                },
                "example": {
                  "id": "string",
                  "name": "string",
                  "priceCents": 1,
                  "createdAt": "string"
                },
                "x-voltro-example": "derived"
              }
            }
          },
          "400": {
            "description": "Invalid request — the input failed schema decode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a product by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "priceCents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": true
              },
              "example": {
                "name": "string",
                "priceCents": 0
              },
              "x-voltro-example": "derived"
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "priceCents": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "priceCents",
                    "createdAt"
                  ],
                  "additionalProperties": true
                },
                "example": {
                  "id": "string",
                  "name": "string",
                  "priceCents": 1,
                  "createdAt": "string"
                },
                "x-voltro-example": "derived"
              }
            }
          },
          "400": {
            "description": "Invalid request — the input failed schema decode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete a product by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "additionalProperties": true
                },
                "example": {
                  "id": "string",
                  "deleted": true
                },
                "x-voltro-example": "derived"
              }
            }
          },
          "400": {
            "description": "Invalid request — the input failed schema decode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoltroHttpError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VoltroHttpError": {
        "type": "object",
        "description": "The serve pipeline's error envelope.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message."
          },
          "detail": {
            "type": "string",
            "description": "Decode failure detail (400 only)."
          },
          "replacement": {
            "type": "string",
            "description": "Replacement endpoint hint (410 only)."
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}