Skip to content

Explore OpenRPC as alternative to OpenAPI for JSON-RPC documentation #39

@r-near

Description

@r-near

Summary

We should explore using OpenRPC for documenting NEAR's JSON-RPC API.

Background

NEAR added OpenAPI spec generation in May 2025. However, OpenAPI was designed for REST APIs and doesn't map cleanly to JSON-RPC, resulting in:

  • 21k+ lines of generated spec with 343 schemas for ~40 RPC methods
  • Fake REST paths (/block, /chunk) when JSON-RPC is really just POST /
  • Significant per-method wrapper type duplication

At the time, OpenRPC appeared unmaintained so we went with OpenAPI.

OpenRPC Status Update

OpenRPC has since become active again:

  • Received Optimism RetroPGF funding in 2025
  • Ethereum officially uses it for the Execution API specification
  • Active development resumed (v2.1.1 released Oct 2025)

Proposal

Evaluate whether OpenRPC would be a better fit for NEAR's JSON-RPC API documentation.

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions