fix(publisher): preserve original JSON field casing (fixes #1110)#1275
Open
tamish-max wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
fix(publisher): preserve original JSON field casing (fixes #1110)#1275tamish-max wants to merge 1 commit intomodelcontextprotocol:mainfrom
tamish-max wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Fixes modelcontextprotocol#1110 — The publisher would unmarshal and re-marshal server.json through Go structs, which silently renamed fields to match struct tags. Now sends the original JSON bytes directly (after validation), making field name preservation structural rather than dependent on tag correctness. Adds regression tests verifying camelCase field names in API requests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Fixes #1110
Problem
publishToRegistry() and validateViaAPI() unmarshal server.json then re-marshal through Go structs. This made field naming dependent on struct tags — when tags were snake_case, the API received snake_case and returned 422.
Fix
The struct tags were already fixed in PR #488, but this change makes the fix structural — even if tags drift, the original file content is preserved.