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.rb reads every _data/apidefinitions/*.yml except broadcast operation catalogs (broadcast_ops.yml, broadcast_ops_customs.yml).
  • Each documented api_method becomes an OpenRPC method. parameter_json / expected_response_json are parsed into JSON Schema (object, array, or scalar). AppBase methods get a named params object; condenser_api gets a positional params array. Obsolete methods are deprecated.
  • 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.rb writes the files during jekyll build. The languages plugin resets site.dest per locale, so the plugin writes again on :post_write and only when site.dest is the real site root (no /es/openrpc.json copies).

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.txt agent section
  • Resources → Tools
  • Quickstart → Building agents (“Machine-readable JSON-RPC”)

How to regenerate

bundle exec rake export:rpc_schema

Writes 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.

Merge request reports

Loading
Loading