fix(conformance): don't return a resource template from resources/list - #269
Open
shoemoney wants to merge 1 commit into
Open
fix(conformance): don't return a resource template from resources/list#269shoemoney wants to merge 1 commit into
shoemoney wants to merge 1 commit into
Conversation
The everything-server listed "test://template/{id}" in its resources/list
response. Two problems:
- resources/list is specified to return direct resources; templates belong in
resources/templates/list.
- "{id}" is not a valid URI, so the response failed the spec's JSON schema
check on ListResourcesResult/resources/N/uri (format: "uri").
There was no ListResourceTemplates handler registered at all, so the template
was never reachable at its correct endpoint either.
Moves the template to a resources/templates/list handler. The ReadResource
handler already understood the test://template/ prefix, so template reads are
unaffected.
Verified against the official conformance runner on macOS 26 / arm64,
Swift 6.2.4:
before 67 passed, 2 failed (resources-list, elicitation-sep1330-enums)
after 68 passed, 1 failed (elicitation-sep1330-enums)
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.
The everything-server listed
test://template/{id}in itsresources/listresponse. Two problems:resources/listis specified to return direct resources; templates belong inresources/templates/list.{id}is not a valid URI, so the response fails the spec's JSON-schema check onListResourcesResult/resources/3/uri(format: "uri").There was no
ListResourceTemplateshandler registered at all, so the template was never reachable at its correct endpoint either. This moves it to aresources/templates/listhandler. TheReadResourcehandler already understood thetest://template/prefix, so template reads are unaffected.Verified against the official conformance runner on macOS 26 / arm64, Swift 6.2.4:
Found while adding a
swift-sdkentry to the conformance matrix: modelcontextprotocol/conformance#432.