Normalize empty notification params to {} (PHP [] → JSON object) + typo fix#135
Closed
csfh wants to merge 3 commits intolaravel:mainfrom
Closed
Normalize empty notification params to {} (PHP [] → JSON object) + typo fix#135csfh wants to merge 3 commits intolaravel:mainfrom
csfh wants to merge 3 commits intolaravel:mainfrom
Conversation
… 'primitive' Co-authored-by: csfh <5760821+csfh@users.noreply.github.com>
…n-serialization Fix JSON-RPC notification empty params serialization and typo.
|
Thanks for submitting a PR! In order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, see the relevant GitHub documentation. Additionally, GitHub doesn't allow maintainer permissions from organization accounts. Please resubmit this PR from a personal GitHub account with maintainer permissions enabled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This PR fixes an interop issues caused by PHP JSON serialization, correctly, of
[](PHP empty array) into[](JSON empty array). But MCP notifications expect params to be an object, even if it's empty.Here is the link from the specification.
https://modelcontextprotocol.io/specification/2025-03-26/basic?utm_source=chatgpt.com#notifications
User benefits
Safety
Tests
[]params pass.I had earlier on discovered a meaningless typo, that I did not intend to bring up, but since I am submitting a PR anyway I figured that would be okay to resolve.
Other options
I do see that the spec allows for
paramsto be omitted entirely, but I consider that a larger and potentially more risky resolution.AI
I delegated the fix for this to GitHub Copilot. I have reviewed and verified the fix.