core-rs-albatross
core-rs-albatross copied to clipboard
Missing Types and Incorrect Typings in `openrpc.json`
While working on creating TypeScript typings from the generated openrpc.json
file, I noticed some issues:
1. Missing Types
Certain types that are defined in the source code are missing from the openrpc.json
. For example, the following type is not included:
Type Definition
There may be other missing types as well.
2. Incorrect Typings for Subscribe Methods
The typings for all subscribe
methods in the openrpc.json
appear to be incorrect. For example:
{
"name": "subscribeForHeadBlock",
"description": "Subscribes to new block events (retrieves the full block).",
"tags": [
{
"name": "blockchain"
},
{
"name": "stream"
}
],
"params": [
{
"name": "includeBody",
"schema": {
"type": "boolean"
},
"required": true
}
],
"result": {
"name": "BoxStream",
"schema": {
"type": "number"
}
}
}
The result states it returns a number, but that is not what the stream actually sends.
Impact
These issues make it difficult to rely on the openrpc.json as a source of truth for interacting with the RPC server. Developers are forced to figure out the actual behavior themselves, which leads to a poor developer experience.
Proposed Improvements
Ensure all relevant types from the source code are included in the openrpc.json. Correct the typings for the subscribe methods to accurately represent the structure and type of the data they return.
Thank you for addressing this issue!