fix: allow null id in JSONRPCError per JSON-RPC 2.0 spec (#2056)
This commit is contained in:
parent
3b53fb9a00
commit
705497a593
1 changed files with 151 additions and 24 deletions
|
|
@ -244,11 +244,11 @@ class StreamableHTTPSessionManager:
|
|||
# See: https://github.com/modelcontextprotocol/python-sdk/issues/1821
|
||||
error_response = JSONRPCError(
|
||||
jsonrpc="2.0",
|
||||
id="server-error",
|
||||
id=None,
|
||||
error=ErrorData(code=INVALID_REQUEST, message="Session not found"),
|
||||
)
|
||||
response = Response(
|
||||
content=error_response.model_dump_json(by_alias=True, exclude_none=True),
|
||||
content=error_response.model_dump_json(by_alias=True, exclude_unset=True),
|
||||
status_code=HTTPStatus.NOT_FOUND,
|
||||
media_type="application/json",
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue