server-js
server-js copied to clipboard
JSONRPCResponse: id doesn't allow null
Describe the bug
According to https://www.jsonrpc.org/specification section 5 Response object when there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), id
MUST be Null.
But in JSONRPCResponse in https://github.com/open-rpc/server-js/blob/master/src/transports/server-transport.ts id
is defined as string
or undefined
:
export interface JSONRPCResponse {
jsonrpc: string;
id?: string;
result?: any;
error?: JSONRPCErrorObject;
}
Should it be defined as id: string | null
instead?