{
  "openapi": "3.1.0",
  "info": {
    "title": "RichProof",
    "version": "0.1.4",
    "description": "Validate JSON-LD against the Schema.org vocabulary. Never fetches URLs. Free: about 30/min per IP, shared daily pool about 20000. Schema.org vocabulary © Schema.org, used under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0): https://schema.org/docs/terms.html. RichProof is not affiliated with or endorsed by Schema.org or its sponsors.",
    "contact": {
      "email": "digitalpromohub.support@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://richproof.mike-tusa.workers.dev"
    }
  ],
  "paths": {
    "/api/validate": {
      "post": {
        "operationId": "validateJsonLd",
        "summary": "Validate JSON-LD or HTML containing JSON-LD",
        "requestBody": {
          "required": true,
          "content": {
            "application/ld+json": {
              "schema": {
                "type": "string",
                "maxLength": 65536
              }
            },
            "text/html": {
              "schema": {
                "type": "string",
                "maxLength": 65536
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "maxLength": 65536
              }
            },
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "input": {
                        "type": "string",
                        "maxLength": 65536
                      }
                    },
                    "required": [
                      "input"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "description": "Raw JSON-LD document"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation report",
            "headers": {
              "X-RichProof-Quota-Remaining": {
                "schema": {
                  "type": "string"
                },
                "description": "Approximate validations left in the shared daily pool"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: empty input, or JSON nested deeper than 256 levels (rejected before rate limits or the daily pool are charged)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or daily_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "internal_error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "validateGetNotAllowed",
        "summary": "Not supported (content must not go in URLs)",
        "responses": {
          "405": {
            "description": "method_not_allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Health and version",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "version": {
                      "type": "string"
                    },
                    "day": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP server (JSON-RPC 2.0 over Streamable HTTP, stateless)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request, notification or batch (max 10, at most one tools/call)"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response (or batch array)"
                }
              }
            }
          },
          "202": {
            "description": "Notification or client response accepted (empty body)"
          },
          "400": {
            "description": "Parse error, invalid request or protocol/header mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response (or batch array)"
                }
              }
            }
          },
          "403": {
            "description": "Origin not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response (or batch array)"
                }
              }
            }
          },
          "404": {
            "description": "Method not found (2026-07-28 requests)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response (or batch array)"
                }
              }
            }
          },
          "413": {
            "description": "Body too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response (or batch array)"
                }
              }
            }
          },
          "429": {
            "description": "Too many MCP requests (Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response (or batch array)"
                }
              }
            }
          },
          "500": {
            "description": "Internal error"
          }
        }
      },
      "get": {
        "operationId": "mcpGet",
        "summary": "Not supported (no SSE stream)",
        "responses": {
          "405": {
            "description": "Method not allowed",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "POST, OPTIONS"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "mcpDelete",
        "summary": "Not supported (no sessions)",
        "responses": {
          "405": {
            "description": "Method not allowed",
            "headers": {
              "Allow": {
                "schema": {
                  "type": "string",
                  "const": "POST, OPTIONS"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "invalid_input",
                  "too_large",
                  "rate_limited",
                  "daily_limit",
                  "method_not_allowed",
                  "not_found",
                  "internal_error"
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Issue": {
        "type": "object",
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "error",
              "warning",
              "info"
            ]
          },
          "code": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "suggestion": {
            "type": "string"
          }
        },
        "required": [
          "level",
          "code",
          "path",
          "message"
        ]
      },
      "Report": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "summary": {
            "type": "object",
            "properties": {
              "errors": {
                "type": "integer"
              },
              "warnings": {
                "type": "integer"
              },
              "infos": {
                "type": "integer"
              },
              "blocks": {
                "type": "integer"
              },
              "nodes": {
                "type": "integer"
              },
              "types": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "source": {
                "type": "string",
                "enum": [
                  "json",
                  "html"
                ]
              }
            }
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Issue"
            }
          },
          "truncated": {
            "type": "boolean"
          },
          "meta": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string"
              },
              "vocabulary": {
                "type": "string"
              },
              "vocabularyLicense": {
                "type": "string"
              },
              "fetchesUrls": {
                "type": "boolean",
                "const": false
              }
            }
          }
        },
        "required": [
          "valid",
          "summary",
          "issues",
          "meta"
        ]
      }
    }
  }
}