Updated sse/streamable uri constraints #576
Closed
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.
Added token substitution support to SSE transport URIs to fix failing schema validations in public servers (bug fix)
Constrained token substitution to only package transport uris (where there is something to resolve tokens against)
Motivation and Context
Quite a number of existing servers failed schema validation because of package SSE transports with tokens in their uris. It appears that the intent was to support variable substitution in both streamable and sse transport uris, but the change enabling that was only applied to streamable (where the
description
was updated and theformat: uri
was removed).It also appears to be the case that variable substitution is only intended to be supported for transports inside of packages where there is something to resolve the variables against. The original streamable change would have allowed for tokens in remote transport uris as well (which would be unresolvable).
This change makes StreamableHttpTransport and SseTransport work like they used to (restored
format: uri
, and reverted to simplified description). And it makes new PackageStreamableHttpTransport and PackageSseTransport derived from those that overrides the uri properties with ones that support variable substitution (description, pattern, and examples with variable substitution).How Has This Been Tested?
I ran schema validation with a local typescript script against all servers with current schema version using Ajv before and after and verified results. If there is a tooling in the repo that would be better, please let me know.
Breaking Changes
No breaking changes
Types of changes
Checklist