Skip to content

JSONRPCResponse: id doesn't allow null #414

@zmeyc

Description

@zmeyc

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?

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