OpenRPC Support

Generating OpenRPC specs

php bin/generate-docs.php --format=openrpc --output=docs/openrpc.json

Produces an OpenRPC 1.3.2 compliant specification from your handlers.

Validation approach

The OpenRPC output is validated using:

Honest scope

The validation is structural, not formal. It checks:

It does not validate against the full JSON Schema meta-schema using a machine validator. Full formal validation against the official JSON Schema would require a complete JSON Schema validator library, which this project intentionally avoids as a runtime dependency.

PHP type to JSON Schema mapping

PHP TypeJSON Schema
int{"type":"integer"}
float{"type":"number"}
bool{"type":"boolean"}
string{"type":"string"}
array{"type":"array"}
array<T>{"type":"array","items":...}
object{"type":"object"}
?T{"oneOf":[{"type":"T"},{"type":"null"}]}
mixed{"description":"Any value"}
void{"type":"null"}