Making Endpoint optional on transport options #562
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.
Making the
Endpoint
optional, and nullable, onSseClientTransportOptions
to better support integration with Aspire.Fixes #515
Motivation and Context
As described in #515, the requirement to provide an
Endpoint
poses a challenge when working with Aspire, or anything that might want to delegate the endpoint to theHttpClient
using an implementation ofIServiceEndpointProvider
.How Has This Been Tested?
I've added a .NET Aspire sample (app host, service defaults and mcp server/client).
Breaking Changes
There's an API breaking change as the
Endpoint
property is now nullable (and notrequired
).Types of changes
Checklist
Additional context
I've creating this as a draft PR initially as there's many failing tests, as there's many places we provide an
Endpoint
andHttpClient
, but they don't match addresses, and I'm not sure the role of theHttpClient
in those tests.