Export Hive JSON-RPC as OpenRPC and OpenAPI
Summary
Closes #85 (closed)
Generate machine-readable Hive JSON-RPC schemas from _data/apidefinitions so agents and codegen can ingest documented methods without scraping HTML. OpenRPC is the primary artifact; OpenAPI 3 is a thin JSON-RPC overlay (not a REST API).
Related to #84 (closed) (agent onboarding / llms.txt).
Approach
lib/export/rpc_schema.rbreads every_data/apidefinitions/*.ymlexcept broadcast operation catalogs (broadcast_ops.yml,broadcast_ops_customs.yml).- Each documented
api_methodbecomes an OpenRPC method.parameter_json/expected_response_jsonare parsed into JSON Schema (object, array, or scalar). AppBase methods get a namedparamsobject;condenser_apigets a positionalparamsarray. Obsolete methods aredeprecated. - Shapes are inferred from the portal examples. They are illustrative, not a complete on-chain type system. The HTML API reference stays authoritative.
_plugins/rpc_schema_generator.rbwrites the files duringjekyll build. The languages plugin resetssite.destper locale, so the plugin writes again on:post_writeand only whensite.destis the real site root (no/es/openrpc.jsoncopies).
Paths
| Artifact | Published URL | Local regenerate |
|---|---|---|
| OpenRPC 1.3.2 | /openrpc.json → https://developers.hive.io/openrpc.json |
api/openrpc.json |
| OpenAPI 3.0.3 | /openapi.json → https://developers.hive.io/openapi.json |
api/openapi.json |
After merge to develop, staging is https://developers-staging.hive.io/openrpc.json and https://developers-staging.hive.io/openapi.json.
Linked from:
llms.txtagent section- Resources → Tools
- Quickstart → Building agents (“Machine-readable JSON-RPC”)
How to regenerate
bundle exec rake export:rpc_schemaWrites api/openrpc.json and api/openapi.json (gitignored). Override the directory with RPC_SCHEMA_DIR. The published copies are produced by the Jekyll build; do not commit them.
bundle exec rake test includes test/rpc_schema_export_test.rb, which checks the documents are valid JSON, include condenser_api.get_dynamic_global_properties, database_api.get_dynamic_global_properties, database_api.find_accounts, rc_api.find_rc_accounts, and bridge.get_post, and that a site build publishes the files and the docs links.
Out of scope
No MCP server, no on-chain RPC changes, no broadcast-op schema export.