-
Notifications
You must be signed in to change notification settings - Fork 394
Bump C# TCGC to 0.72.0 and regenerate clients #11928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,10 @@ function Get-TspCommand { | |
| ) | ||
| $emitterDir = Resolve-Path (Join-Path $PSScriptRoot '..' '..') | ||
| $command = "npx tsp compile $specFile" | ||
| $customizationFile = Join-Path $generationDir "client.tsp" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copilot why are these changes needed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pinned |
||
| if (Test-Path $customizationFile) { | ||
| $command += " --import $customizationFile" | ||
| } | ||
| $command += " --trace @typespec/http-client-csharp" | ||
| $command += " --emit $emitterDir" | ||
| $configFile = Join-Path $generationDir "tspconfig.yaml" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "package-name": "Response.BodyOrNoContent" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <Project> | ||
| <ItemGroup> | ||
| <JsonSchemaSegment Include="$(MSBuildThisFileDirectory)..\..\ConfigurationSchema.json" | ||
| FilePathPattern="appsettings.*.json" /> | ||
| </ItemGroup> | ||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <Solution> | ||
| <Project Path="src/Response.BodyOrNoContent.csproj" /> | ||
| </Solution> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.ClientModel; | ||
| using System.ClientModel.Primitives; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| public partial class BodyOrNoContentClient | ||
| { | ||
| public BodyOrNoContentClient() : this(new Uri("http://localhost:3000"), new BodyOrNoContentClientOptions()) => throw null; | ||
|
|
||
| internal BodyOrNoContentClient(AuthenticationPolicy authenticationPolicy, Uri endpoint, BodyOrNoContentClientOptions options) => throw null; | ||
|
|
||
| public BodyOrNoContentClient(Uri endpoint, BodyOrNoContentClientOptions options) : this(null, endpoint, options) => throw null; | ||
|
|
||
| [Experimental("SCME0002")] | ||
| public BodyOrNoContentClient(BodyOrNoContentClientSettings settings) : this(AuthenticationPolicy.Create(settings), settings?.Endpoint, settings?.Options) => throw null; | ||
|
|
||
| public ClientPipeline Pipeline => throw null; | ||
|
|
||
| public virtual ClientResult GetBody(RequestOptions options) => throw null; | ||
|
|
||
| public virtual Task<ClientResult> GetBodyAsync(RequestOptions options) => throw null; | ||
|
|
||
| public virtual ClientResult<BlobLayout> GetBody(CancellationToken cancellationToken = default) => throw null; | ||
|
|
||
| public virtual Task<ClientResult<BlobLayout>> GetBodyAsync(CancellationToken cancellationToken = default) => throw null; | ||
|
|
||
| public virtual ClientResult GetNoContent(RequestOptions options) => throw null; | ||
|
|
||
| public virtual Task<ClientResult> GetNoContentAsync(RequestOptions options) => throw null; | ||
|
|
||
| public virtual ClientResult<BlobLayout> GetNoContent(CancellationToken cancellationToken = default) => throw null; | ||
|
|
||
| public virtual Task<ClientResult<BlobLayout>> GetNoContentAsync(CancellationToken cancellationToken = default) => throw null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ClientModel.Primitives; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using Microsoft.Extensions.Configuration; | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| public partial class BodyOrNoContentClientOptions : ClientPipelineOptions | ||
| { | ||
| public BodyOrNoContentClientOptions() => throw null; | ||
|
|
||
| [Experimental("SCME0002")] | ||
| internal BodyOrNoContentClientOptions(IConfigurationSection section) : base(section) => throw null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.ClientModel.Primitives; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using Microsoft.Extensions.Configuration; | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| [Experimental("SCME0002")] | ||
| public partial class BodyOrNoContentClientSettings : ClientSettings | ||
| { | ||
| public Uri Endpoint | ||
| { | ||
| get => throw null; | ||
| set => throw null; | ||
| } | ||
|
|
||
| public BodyOrNoContentClientOptions Options | ||
| { | ||
| get => throw null; | ||
| set => throw null; | ||
| } | ||
|
|
||
| protected override void BindCore(IConfigurationSection section) => throw null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.ClientModel; | ||
| using System.ClientModel.Primitives; | ||
| using System.Text.Json; | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| public partial class BlobLayout : IJsonModel<BlobLayout> | ||
| { | ||
| internal BlobLayout() => throw null; | ||
|
|
||
| protected virtual BlobLayout PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| BinaryData IPersistableModel<BlobLayout>.Write(ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| BlobLayout IPersistableModel<BlobLayout>.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| string IPersistableModel<BlobLayout>.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| public static explicit operator BlobLayout(ClientResult result) => throw null; | ||
|
|
||
| void IJsonModel<BlobLayout>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| BlobLayout IJsonModel<BlobLayout>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; | ||
|
|
||
| protected virtual BlobLayout JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| public partial class BlobLayout | ||
| { | ||
| public string Content => throw null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ClientModel.Primitives; | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| [ModelReaderWriterBuildable(typeof(BlobLayout))] | ||
| public partial class ResponseBodyOrNoContentContext : ModelReaderWriterContext | ||
| { | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // <auto-generated/> | ||
|
|
||
| #nullable disable | ||
|
|
||
| namespace Response.BodyOrNoContent | ||
| { | ||
| public static partial class ResponseBodyOrNoContentModelFactory | ||
| { | ||
| public static BlobLayout BlobLayout(string content = default) => throw null; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "Clients": { | ||
| "type": "object", | ||
| "properties": { | ||
| "BodyOrNoContentClient": { | ||
| "type": "object", | ||
| "description": "Configuration for BodyOrNoContentClient.", | ||
| "properties": { | ||
| "Endpoint": { | ||
| "type": "string", | ||
| "format": "uri", | ||
| "description": "Gets or sets the Endpoint." | ||
| }, | ||
| "Credential": { | ||
| "$ref": "#/definitions/credential" | ||
| }, | ||
| "Options": { | ||
| "$ref": "#/definitions/bodyOrNoContentClientOptions" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "additionalProperties": { | ||
| "type": "object", | ||
| "description": "Configuration for a named client instance." | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "bodyOrNoContentClientOptions": { | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/options" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <Description>This is the Response.BodyOrNoContent client library for developing .NET applications with rich experience.</Description> | ||
| <AssemblyTitle>SDK Code Generation Response.BodyOrNoContent</AssemblyTitle> | ||
| <Version>1.0.0-beta.1</Version> | ||
| <PackageTags>Response.BodyOrNoContent</PackageTags> | ||
| <TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks> | ||
| <LangVersion>latest</LangVersion> | ||
| <GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="System.ClientModel" Version="1.15.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="Generated\schema\ConfigurationSchema.json" Pack="true" PackagePath="\" /> | ||
| <None Include="..\Response.BodyOrNoContent.NuGet.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\Response.BodyOrNoContent.targets" /> | ||
| </ItemGroup> | ||
| </Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot why are these changes needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assertions cover the file-upload fix shipped in TCGC 0.72.0 (Azure/typespec-azure#5306): an unspecified content type becomes an optional string defaulting to
application/octet-stream. They failed on 0.71.2 (constantinstead ofstring) and pass on 0.72.0. They aren't required to perform the bump; they're focused regression coverage confirming that the C# emitter preserves the new behavior.