Skip to content

Handle omitted/unused optional parameters in a JSON-RPC request#314

Merged
msgilligan merged 1 commit intoConsensusJ:masterfrom
liamgilligan:jrpc-param-handling
Feb 24, 2026
Merged

Handle omitted/unused optional parameters in a JSON-RPC request#314
msgilligan merged 1 commit intoConsensusJ:masterfrom
liamgilligan:jrpc-param-handling

Conversation

@liamgilligan
Copy link
Contributor

@liamgilligan liamgilligan commented Feb 10, 2026

JSON-RPC allows for unused optional parameters to be omitted from the params member of a Request object. params is represented by an Array. It only requires that required parameters are present and that the present parameters are in the order the server expects. For more details, see https://www.jsonrpc.org/specification#parameter_structures

This PR adds the server-side functionality to handle these omitted parameters when they are given by-position, as specified in the JSON-RPC spec.

Copy link
Member

@msgilligan msgilligan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I have three minor requests.

JSON-RPC allows for unused optional parameters to be omitted from the `params` member of a Request object when `params` is represented by an Array. It only requires that required parameters are present and that the present parameters are in the order the server expects. For more details, see https://www.jsonrpc.org/specification\#parameter_structures
Copy link
Member

@msgilligan msgilligan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Thanks!

@msgilligan msgilligan marked this pull request as ready for review February 24, 2026 00:01
@msgilligan msgilligan added this pull request to the merge queue Feb 24, 2026
@msgilligan msgilligan changed the title Add functionality for the omission of unused optional parameters in a JSON-RPC request Handle omitted/unused optional parameters in a JSON-RPC request Feb 24, 2026
Merged via the queue into ConsensusJ:master with commit c125801 Feb 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants