X Tutup
Skip to content

Unnecessary Request and Notification objects #2126

@Kludex

Description

@Kludex

Hi 👋

I'm trying to improve the typing situation in the Python SDK, and I was trying to understand the Notification and Request objects in the JSON schema.

If we see the definition of both of them in the schema.json, they are never referenced:

"Request": {
"properties": {
"method": {
"type": "string"
},
"params": {
"additionalProperties": {},
"type": "object"
}
},
"required": [
"method"
],
"type": "object"
},

If we check how it's being used in the schema.ts, we can see that it's only used in JSONRPCRequest:

export interface JSONRPCRequest extends Request {
jsonrpc: typeof JSONRPC_VERSION;
id: RequestId;
}


I belive those types are redudant, given that the types that are really relevant are JSONRPCRequest and JSONRPCNotification. Can we drop them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup