Skip to content

Add streaming client results to the C# emitter - #11692

Closed
JoshLove-msft wants to merge 12 commits into
microsoft:mainfrom
JoshLove-msft:josh/streaming-client-results
Closed

Add streaming client results to the C# emitter#11692
JoshLove-msft wants to merge 12 commits into
microsoft:mainfrom
JoshLove-msft:josh/streaming-client-results

Conversation

@JoshLove-msft

Copy link
Copy Markdown
Contributor

Summary

  • add C# client support for streaming request and response results, including JSONL and SSE
  • enable the JSONL send Spector scenario now that the upstream Spector gap is resolved
  • add C# Spector coverage for nested @bodyRoot parameters and dollar-sign query parameters
  • track unsupported boolean string encoding separately in C# emitter ignores @encode(string) on boolean model properties #11691

Validation

  • npm run build
  • pwsh eng/scripts/Test-Spector.ps1 -filter "http/parameters/body-root"
  • pwsh eng/scripts/Test-Spector.ps1 -filter "http/parameters/query"
  • pwsh eng/scripts/Test-Spector.ps1 -filter "http/streaming/jsonl"
  • dotnet build generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj -p:NuGetAudit=false --no-restore
  • dotnet format whitespace generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj --include generator/TestProjects/Spector.Tests/Http/Parameters/BodyRoot/BodyRootTests.cs generator/TestProjects/Spector.Tests/Http/Parameters/Query/QueryTests.cs --verify-no-changes --no-restore
  • npm run cop

JoshLove-msft and others added 12 commits July 29, 2026 15:32
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Update System.ClientModel to 1.15.0, suppress the experimental streaming diagnostic in generated clients, and address streaming review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Only emit JsonLinesBinaryContent for JSON Lines request operations and route generated ModelReaderWriter calls through context-aware snippets.

Fixes microsoft#11570

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e02ee7d0-8d27-46f8-a856-222d6a938ecd
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fce3f59e-5e13-4881-96b8-bc2cc41dcf44
Copilot AI lite review requested due to automatic review settings August 15, 2026 03:43
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Aug 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class streaming support to the TypeSpec C# emitter, enabling JSON Lines (JSONL) request/response streaming and SSE response streaming, and expands Spector coverage for body-root and special query parameter scenarios. It also updates the C# generator/emitter pipeline to carry a new streaming input type end-to-end and bumps dependencies (notably System.ClientModel) required for the new streaming APIs.

Changes:

  • Introduce InputStreamingType in the TS emitter model and C# generator input pipeline, including JSON serialization support and type resolution to IAsyncEnumerable<T>.
  • Emit unbuffered AsyncStreamingClientResult<> for streaming responses and JSONL BinaryContent support for streaming requests; add SSE/JSONL Spector test projects + NUnit test coverage.
  • Update Spector infra and dependency versions (System.ClientModel 1.15.0, newer @typespec/* packages including @typespec/events).

Reviewed changes

Copilot reviewed 125 out of 148 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/http-client-csharp/package.json Add @typespec/events and bump http-specs/spector versions for new streaming scenarios.
packages/http-client-csharp/generator/Packages.Data.props Bump System.ClientModel + related Microsoft.Extensions.* versions.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/NewProjectScaffolding.cs Update scaffolded System.ClientModel dependency version.
packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/SampleTypeSpec.csproj Bump System.ClientModel to 1.15.0 for local sample.
packages/http-client-csharp/generator/TestProjects/Spector.Tests/TestProjects.Spector.Tests.csproj Add references for new streaming/body-root Spector test projects.
packages/http-client-csharp/generator/TestProjects/Spector.Tests/Infrastructure/TestServerBase.cs Adjust server host/port parsing for Spector startup output.
packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Streaming/Jsonl/JsonlTests.cs Add NUnit coverage for JSONL send/receive streaming.
packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Streaming/Sse/SseTests.cs Add NUnit coverage for SSE streaming (unnamed/named/retrieve).
packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Parameters/Query/QueryTests.cs Add Spector coverage for dollar-sign query parameter.
packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Parameters/BodyRoot/BodyRootTests.cs Add Spector coverage for nested @bodyRoot parameters.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/common/InputFactory.cs Add bufferResponse control for building InputOperation test models.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Utilities/ExternalTypeReferenceResolver.cs Ensure external type collection traverses streaming types.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/TypeFactory.cs Map InputStreamingType to IAsyncEnumerable<T> in type resolution.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/CSharpType.cs Expose IsIAsyncEnumerableOfT to support streaming-aware generation logic.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Snippets/MemoryStreamSnippets.cs Add ToArray() snippet helper used by JSONL content writer.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Properties/launchSettings.json Add generator launch profiles for streaming Spector projects.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/InputStreamingType.cs New input model type representing streaming values.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/TypeSpecSerialization.cs Register streaming type JSON converter.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputTypeConverter.cs Route "kind":"streaming" to the new converter.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/src/InputTypes/Serialization/InputStreamingTypeConverter.cs Implement JSON deserialization for InputStreamingType.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.Input/test/TypeSpecInputConverterTests.cs Add unit test validating streaming type deserialization.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Utilities/DiagnosticCodes.cs Add diagnostic code for unsupported streaming types.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmTypeFactory.cs Ensure streaming types participate in root output model discovery.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/ScmOutputLibrary.cs Conditionally include JSONL request content helper type provider(s).
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/ModelReaderWriterSnippets.cs Centralize MRW read/write snippet usage (shared by streaming paths).
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Snippets/AsyncStreamingClientResultSnippets.cs Add snippet helpers for CreateJsonLines/CreateSse streaming results.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/JsonLinesBinaryContentDefinition.cs New JSONL streaming request content implementation.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProviderCollection.cs Generate streaming protocol/convenience methods + unbuffered streaming results.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ClientProvider.cs Suppress experimental warnings for streaming results when present.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MultipartFormDataSerializationDefinition.cs Refactor to use MRW snippet helpers for multipart serialization.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.Dynamic.cs Refactor to use MRW snippet helpers in dynamic MRW paths.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs Refactor MRW read/write calls via snippets; preserve behavior.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelSerializationExtensionsDefinition.Xml.cs Refactor MRW write calls via snippets in XML paths.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs Add unit tests for JSONL/SSE request/response streaming generation.
packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestMultipartClient_UploadMethods_OptionalBody.cs Update expected output (currently has a signature/call mismatch).
packages/http-client-csharp/eng/scripts/Spector-Helper.psm1 Enable JSONL streaming Spector scenario (remove from known failing list).
packages/http-client-csharp/emitter/src/type/input-type.ts Add InputStreamingType to emitter input-type union and schema.
packages/http-client-csharp/emitter/src/lib/operation-converter.ts Convert supported stream metadata to kind:"streaming" and disable buffering for streaming responses.
packages/http-client-csharp/emitter/test/Unit/utils/test-util.ts Register Events/SSE/Streams libraries and enable conditional SSE imports for tests.
packages/http-client-csharp/emitter/test/Unit/operation-converter.test.ts Add unit tests validating JSONL and SSE stream metadata conversion.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/Configuration.json New JSONL streaming Spector test project configuration.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/Streaming.Jsonl.slnx New JSONL streaming Spector solution definition.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/Streaming.Jsonl.NuGet.targets Package targets for JSONL streaming Spector project.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/tspCodeModel.json JSONL streaming code model snapshot for generator tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Streaming.Jsonl.csproj New JSONL streaming generated library project (System.ClientModel 1.15.0).
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/Basic.cs Generated JSONL streaming client surface (send/receive).
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/JsonlClient.cs Generated JSONL root client.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/JsonlClientOptions.cs Generated JSONL client options.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/JsonlClientSettings.cs Generated JSONL client settings.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/StreamingJsonlModelFactory.cs Generated JSONL model factory.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/Models/StreamingJsonlContext.cs Generated MRW context for JSONL models.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/Models/Info.cs Generated JSONL model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/Models/Info.Serialization.cs Generated JSON serialization for JSONL model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/jsonl/src/Generated/schema/ConfigurationSchema.json Generated JSONL configuration schema.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/Configuration.json New SSE streaming Spector test project configuration.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/Streaming.Sse.slnx New SSE streaming Spector solution definition.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/Streaming.Sse.NuGet.targets Package targets for SSE streaming Spector project.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/tspCodeModel.json SSE streaming code model snapshot for generator tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Streaming.Sse.csproj New SSE streaming generated library project (System.ClientModel 1.15.0).
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/SseClient.cs Generated SSE root client.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/SseClientOptions.cs Generated SSE client options.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/SseClientSettings.cs Generated SSE client settings.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Named.cs Generated SSE subclient (named events).
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Unnamed.cs Generated SSE subclient (unnamed events).
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Retrieve.cs Generated SSE subclient (retrieve/stream).
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/StreamingSseModelFactory.cs Generated SSE model factory.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/StreamingSseContext.cs Generated MRW context for SSE models.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/Info.cs Generated SSE model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/Info.Serialization.cs Generated JSON serialization for SSE model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/RetrievalRequest.cs Generated SSE request model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/Models/RetrievalRequest.Serialization.cs Generated JSON serialization for SSE request model.
packages/http-client-csharp/generator/TestProjects/Spector/http/streaming/sse/src/Generated/schema/ConfigurationSchema.json Generated SSE configuration schema.
packages/http-client-csharp/generator/TestProjects/Spector/http/encode/array/src/Encode.Array.csproj Bump System.ClientModel to 1.15.0 for Spector encode tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/encode/boolean/src/Encode.Boolean.csproj Bump System.ClientModel to 1.15.0 for Spector encode tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/encode/bytes/src/Encode.Bytes.csproj Bump System.ClientModel to 1.15.0 for Spector encode tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/encode/datetime/src/Encode.Datetime.csproj Bump System.ClientModel to 1.15.0 for Spector encode tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/encode/duration/src/Encode.Duration.csproj Bump System.ClientModel to 1.15.0 for Spector encode tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/encode/numeric/src/Encode.Numeric.csproj Bump System.ClientModel to 1.15.0 for Spector encode tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/basic/src/Parameters.Basic.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-optionality/src/Parameters.BodyOptionality.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/body-root/src/Parameters.BodyRoot.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/collection-format/src/Parameters.CollectionFormat.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/path/src/Parameters.Path.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/query/src/Parameters.Query.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/parameters/spread/src/Parameters.Spread.csproj Bump System.ClientModel to 1.15.0 for Spector parameter tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/content-negotiation/src/Payload.ContentNegotiation.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/head/src/Payload.Head.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/json-merge-patch/src/Payload.JsonMergePatch.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/media-type/src/Payload.MediaType.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/multipart/src/Payload.MultiPart.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/pageable/src/Payload.Pageable.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/payload/xml/src/Payload.Xml.csproj Bump System.ClientModel to 1.15.0 for Spector payload tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/response/status-code-range/src/Response.StatusCodeRange.csproj Bump System.ClientModel to 1.15.0 for Spector response tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v1/src/Resiliency.SrvDriven.V1.csproj Bump System.ClientModel to 1.15.0 for Spector resiliency tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/resiliency/srv-driven/v2/src/Resiliency.SrvDriven.V2.csproj Bump System.ClientModel to 1.15.0 for Spector resiliency tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/routes/src/Routes.csproj Bump System.ClientModel to 1.15.0 for Spector route tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/serialization/encoded-name/json/src/Serialization.EncodedName.Json.csproj Bump System.ClientModel to 1.15.0 for Spector serialization tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/server/endpoint/not-defined/src/Server.Endpoint.NotDefined.csproj Bump System.ClientModel to 1.15.0 for Spector server tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/multiple/src/Server.Path.Multiple.csproj Bump System.ClientModel to 1.15.0 for Spector server tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/server/path/single/src/Server.Path.Single.csproj Bump System.ClientModel to 1.15.0 for Spector server tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/not-versioned/src/Server.Versions.NotVersioned.csproj Bump System.ClientModel to 1.15.0 for Spector server tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/server/versions/versioned/src/Server.Versions.Versioned.csproj Bump System.ClientModel to 1.15.0 for Spector server tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/service/multiple-services/src/Service.MultipleServices.csproj Bump System.ClientModel to 1.15.0 for Spector service tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj Bump System.ClientModel to 1.15.0 for Spector special header tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/special-headers/repeatability/src/SpecialHeaders.Repeatability.csproj Bump System.ClientModel to 1.15.0 for Spector special header tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/special-words/src/SpecialWords.csproj Bump System.ClientModel to 1.15.0 for Spector special words tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/array/src/Type.Array.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/dictionary/src/Type.Dictionary.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/extensible/src/Type.Enum.Extensible.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/enum/fixed/src/Type.Enum.Fixed.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/empty/src/Type.Model.Empty.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/enum-discriminator/src/Type.Model.Inheritance.EnumDiscriminator.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/nested-discriminator/src/Type.Model.Inheritance.NestedDiscriminator.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/not-discriminated/src/Type.Model.Inheritance.NotDiscriminated.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/recursive/src/Type.Model.Inheritance.Recursive.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/inheritance/single-discriminator/src/Type.Model.Inheritance.SingleDiscriminator.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/usage/src/Type.Model.Usage.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/model/visibility/src/Type.Model.Visibility.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/additional-properties/src/Type.Property.AdditionalProperties.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/nullable/src/Type.Property.Nullable.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/optionality/src/Type.Property.Optional.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/property/value-types/src/Type.Property.ValueTypes.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/scalar/src/Type.Scalar.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/type/union/src/Type.Union.csproj Bump System.ClientModel to 1.15.0 for Spector type tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v1/src/Versioning.Added.V1.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/added/v2/src/Versioning.Added.V2.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v1/src/Versioning.MadeOptional.V1.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/madeOptional/v2/src/Versioning.MadeOptional.V2.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v1/src/Versioning.Removed.V1.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2/src/Versioning.Removed.V2.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/removed/v2Preview/src/Versioning.Removed.V2Preview.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v1/src/Versioning.RenamedFrom.V1.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/renamedFrom/v2/src/Versioning.RenamedFrom.V2.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v1/src/Versioning.ReturnTypeChangedFrom.V1.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/returnTypeChangedFrom/v2/src/Versioning.ReturnTypeChangedFrom.V2.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v1/src/Versioning.TypeChangedFrom.V1.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/versioning/typeChangedFrom/v2/src/Versioning.TypeChangedFrom.V2.csproj Bump System.ClientModel to 1.15.0 for Spector versioning tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/api-key/src/Authentication.ApiKey.csproj Bump System.ClientModel to 1.15.0 for Spector auth tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/http/custom/src/Authentication.Http.Custom.csproj Bump System.ClientModel to 1.15.0 for Spector auth tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/oauth2/src/Authentication.OAuth2.csproj Bump System.ClientModel to 1.15.0 for Spector auth tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/authentication/union/src/Authentication.Union.csproj Bump System.ClientModel to 1.15.0 for Spector auth tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/client-operation-group/src/Client.Structure.Service.csproj Bump System.ClientModel to 1.15.0 for Spector client structure tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/default/src/Client.Structure.Service.Default.csproj Bump System.ClientModel to 1.15.0 for Spector client structure tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/multi-client/src/Client.Structure.Service.Multi.Client.csproj Bump System.ClientModel to 1.15.0 for Spector client structure tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/renamed-operation/src/Client.Structure.Service.Renamed.Operation.csproj Bump System.ClientModel to 1.15.0 for Spector client structure tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/client/structure/two-operation-group/src/Client.Structure.Service.TwoOperationGroup.csproj Bump System.ClientModel to 1.15.0 for Spector client structure tests.
packages/http-client-csharp/generator/TestProjects/Spector/http/documentation/src/Documentation.csproj Bump System.ClientModel to 1.15.0 for Spector doc tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}

public virtual async global::System.Threading.Tasks.Task<global::System.ClientModel.ClientResult> UploadAsync(global::System.ClientModel.BinaryContent content, string contentType, global::System.ClientModel.Primitives.RequestOptions options = null)
public virtual async global::System.Threading.Tasks.Task<global::System.ClientModel.ClientResult> UploadAsync(string contentType, global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options = null)
Comment on lines +41 to +48
if (id == null)
{
reader.TryReadReferenceId(ref id);
}

id = id ?? throw new JsonException();
var streamingType = new InputStreamingType(name ?? "Stream", string.Empty, null!, []);
resolver.AddReference(id, streamingType);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants