Skip to content

Commit 80c7061

Browse files
Upgrade deps (#51642)
* Upgrade deps * Add nested paging * regen * Use dev version of typespec-azure-core * regen * remove fixed decorator * upgrade to 1.0.0-alpha.20250807.4 --------- Co-authored-by: Jorge Rangel <[email protected]>
1 parent 58be9ef commit 80c7061

File tree

211 files changed

+13229
-4021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+13229
-4021
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455

456456
<PropertyGroup>
457457
<TestProxyVersion>1.0.0-dev.20250805.1</TestProxyVersion>
458-
<UnbrandedGeneratorVersion>1.0.0-alpha.20250731.2</UnbrandedGeneratorVersion>
458+
<UnbrandedGeneratorVersion>1.0.0-alpha.20250807.4</UnbrandedGeneratorVersion>
459459
<AzureGeneratorVersion>1.0.0-alpha.20250729.4</AzureGeneratorVersion>
460460
</PropertyGroup>
461461
</Project>

eng/http-client-csharp-emitter-package-lock.json

Lines changed: 250 additions & 147 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/http-client-csharp-emitter-package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"main": "dist/src/index.js",
33
"dependencies": {
44
"client-plugin": "file:../../../../eng/packages/plugins/client",
5-
"@typespec/http-client-csharp": "1.0.0-alpha.20250731.2"
5+
"@typespec/http-client-csharp": "1.0.0-alpha.20250807.4"
66
},
77
"devDependencies": {
8-
"@azure-tools/typespec-azure-core": "0.57.0",
9-
"@azure-tools/typespec-client-generator-core": "0.57.2",
10-
"@typespec/compiler": "1.1.0",
11-
"@typespec/http": "1.1.0",
12-
"@typespec/openapi": "1.1.0",
13-
"@typespec/rest": "0.71.0",
14-
"@typespec/versioning": "0.71.0",
15-
"@azure-tools/typespec-azure-rulesets": "0.57.0",
16-
"@azure-tools/typespec-azure-resource-manager": "0.57.0"
8+
"@azure-tools/typespec-azure-core": "0.59.0",
9+
"@azure-tools/typespec-client-generator-core": "0.59.0",
10+
"@typespec/compiler": "1.3.0",
11+
"@typespec/http": "1.3.0",
12+
"@typespec/openapi": "1.3.0",
13+
"@typespec/rest": "0.73.0",
14+
"@typespec/versioning": "0.73.0",
15+
"@azure-tools/typespec-azure-rulesets": "0.59.0",
16+
"@azure-tools/typespec-azure-resource-manager": "0.59.0"
1717
}
1818
}

eng/packages/http-client-csharp/emitter/test/Unit/property-type.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ describe("Test GetInputType for enum", () => {
1818
it("Fixed string enum", async () => {
1919
const program = await typeSpecCompile(
2020
`
21-
#suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "Enums should be defined without the @fixed decorator."
2221
@doc("fixed string enum")
23-
@fixed
2422
enum SimpleEnum {
2523
@doc("Enum value one")
2624
One: "1",
@@ -67,9 +65,7 @@ describe("Test GetInputType for enum", () => {
6765
it("Fixed int enum", async () => {
6866
const program = await typeSpecCompile(
6967
`
70-
#suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "Enums should be defined without the @fixed decorator."
7168
@doc("Fixed int enum")
72-
@fixed
7369
enum FixedIntEnum {
7470
@doc("Enum value one")
7571
One: 1,

eng/packages/http-client-csharp/generator/Azure.Generator/src/AzureTypeFactory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,31 +104,31 @@ public class AzureTypeFactory : ScmTypeFactory
104104

105105
/// <inheritdoc/>
106106
#pragma warning disable AZC0014 // Avoid using banned types in public API
107-
public override ValueExpression DeserializeJsonValue(Type valueType, ScopedApi<JsonElement> element, SerializationFormat format)
107+
public override ValueExpression DeserializeJsonValue(CSharpType valueType, ScopedApi<JsonElement> element, SerializationFormat format)
108108
#pragma warning restore AZC0014 // Avoid using banned types in public API
109109
{
110110
var expression = DeserializeJsonValueCore(valueType, element, format);
111111
return expression ?? base.DeserializeJsonValue(valueType, element, format);
112112
}
113113

114114
private ValueExpression? DeserializeJsonValueCore(
115-
Type valueType,
115+
CSharpType valueType,
116116
ScopedApi<JsonElement> element,
117117
SerializationFormat format)
118118
{
119119
return KnownAzureTypes.TryGetJsonDeserializationExpression(valueType, out var deserializationExpression) ?
120-
deserializationExpression(new CSharpType(valueType), element, format) :
120+
deserializationExpression(valueType, element, format) :
121121
null;
122122
}
123123

124124
/// <inheritdoc/>
125-
public override MethodBodyStatement SerializeJsonValue(Type valueType, ValueExpression value, ScopedApi<Utf8JsonWriter> utf8JsonWriter, ScopedApi<ModelReaderWriterOptions> mrwOptionsParameter, SerializationFormat serializationFormat)
125+
public override MethodBodyStatement SerializeJsonValue(CSharpType valueType, ValueExpression value, ScopedApi<Utf8JsonWriter> utf8JsonWriter, ScopedApi<ModelReaderWriterOptions> mrwOptionsParameter, SerializationFormat serializationFormat)
126126
{
127127
var statement = SerializeValueTypeCore(serializationFormat, value, valueType, utf8JsonWriter, mrwOptionsParameter);
128128
return statement ?? base.SerializeJsonValue(valueType, value, utf8JsonWriter, mrwOptionsParameter, serializationFormat);
129129
}
130130

131-
private MethodBodyStatement? SerializeValueTypeCore(SerializationFormat serializationFormat, ValueExpression value, Type valueType, ScopedApi<Utf8JsonWriter> utf8JsonWriter, ScopedApi<ModelReaderWriterOptions> mrwOptionsParameter)
131+
private MethodBodyStatement? SerializeValueTypeCore(SerializationFormat serializationFormat, ValueExpression value, CSharpType valueType, ScopedApi<Utf8JsonWriter> utf8JsonWriter, ScopedApi<ModelReaderWriterOptions> mrwOptionsParameter)
132132
{
133133
return KnownAzureTypes.TryGetJsonSerializationExpression(valueType, out var serializationExpression) ?
134134
serializationExpression(value, utf8JsonWriter, mrwOptionsParameter, serializationFormat) :

eng/packages/http-client-csharp/generator/Azure.Generator/src/Primitives/KnownAzureTypes.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private static ValueExpression DeserializeResponseError(CSharpType valueType,
6464
[EmbeddingVector] = typeof(ReadOnlyMemory<>)
6565
};
6666

67-
private static readonly IReadOnlyDictionary<Type, SerializationExpression> _typeToSerializationExpression = new Dictionary<Type, SerializationExpression>
67+
private static readonly IReadOnlyDictionary<CSharpType, SerializationExpression> _typeToSerializationExpression = new Dictionary<CSharpType, SerializationExpression>
6868
{
6969
[typeof(Guid)] = SerializeTypeWithImplicitOperatorToString,
7070
[typeof(IPAddress)] = SerializeTypeWithToString,
@@ -74,7 +74,7 @@ private static ValueExpression DeserializeResponseError(CSharpType valueType,
7474
[typeof(ResponseError)] = SerializeResponseError,
7575
};
7676

77-
private static readonly IReadOnlyDictionary<Type, DeserializationExpression> _typeToDeserializationExpression = new Dictionary<Type, DeserializationExpression>
77+
private static readonly IReadOnlyDictionary<CSharpType, DeserializationExpression> _typeToDeserializationExpression = new Dictionary<CSharpType, DeserializationExpression>
7878
{
7979
[typeof(Guid)] = DeserializeNewInstanceStringLikeType,
8080
[typeof(IPAddress)] = DeserializeParsableStringLikeType,
@@ -86,8 +86,8 @@ private static ValueExpression DeserializeResponseError(CSharpType valueType,
8686

8787
public static bool TryGetKnownType(string id, [MaybeNullWhen(false)] out Type type) => _idToTypes.TryGetValue(id, out type);
8888

89-
public static bool TryGetJsonSerializationExpression(Type type, [MaybeNullWhen(false)] out SerializationExpression expression) => _typeToSerializationExpression.TryGetValue(type, out expression);
89+
public static bool TryGetJsonSerializationExpression(CSharpType type, [MaybeNullWhen(false)] out SerializationExpression expression) => _typeToSerializationExpression.TryGetValue(type, out expression);
9090

91-
public static bool TryGetJsonDeserializationExpression(Type type, [MaybeNullWhen(false)] out DeserializationExpression expression) => _typeToDeserializationExpression.TryGetValue(type, out expression);
91+
public static bool TryGetJsonDeserializationExpression(CSharpType type, [MaybeNullWhen(false)] out DeserializationExpression expression) => _typeToDeserializationExpression.TryGetValue(type, out expression);
9292
}
9393
}

eng/packages/http-client-csharp/generator/Azure.Generator/src/Properties/launchSettings.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,26 @@
4545
"commandName": "Executable",
4646
"executablePath": "dotnet"
4747
},
48+
"http-azure-client-generator-core-client-location": {
49+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/azure/client-generator-core/client-location -g AzureStubGenerator",
50+
"commandName": "Executable",
51+
"executablePath": "dotnet"
52+
},
4853
"http-azure-client-generator-core-flatten-property": {
4954
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/azure/client-generator-core/flatten-property -g AzureStubGenerator",
5055
"commandName": "Executable",
5156
"executablePath": "dotnet"
5257
},
58+
"http-azure-client-generator-core-hierarchy-building": {
59+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/azure/client-generator-core/hierarchy-building -g AzureStubGenerator",
60+
"commandName": "Executable",
61+
"executablePath": "dotnet"
62+
},
63+
"http-azure-client-generator-core-override": {
64+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/azure/client-generator-core/override -g AzureStubGenerator",
65+
"commandName": "Executable",
66+
"executablePath": "dotnet"
67+
},
5368
"http-azure-client-generator-core-usage": {
5469
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/azure/client-generator-core/usage -g AzureStubGenerator",
5570
"commandName": "Executable",
@@ -95,6 +110,16 @@
95110
"commandName": "Executable",
96111
"executablePath": "dotnet"
97112
},
113+
"http-client-naming-enum-conflict": {
114+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/client/naming/enum-conflict -g AzureStubGenerator",
115+
"commandName": "Executable",
116+
"executablePath": "dotnet"
117+
},
118+
"http-client-overload": {
119+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/client/overload -g AzureStubGenerator",
120+
"commandName": "Executable",
121+
"executablePath": "dotnet"
122+
},
98123
"http-client-structure-client-operation-group": {
99124
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/client/structure/client-operation-group -g AzureStubGenerator",
100125
"commandName": "Executable",
@@ -339,6 +364,11 @@
339364
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/type/union -g AzureStubGenerator",
340365
"commandName": "Executable",
341366
"executablePath": "dotnet"
367+
},
368+
"http-type-union-discriminated": {
369+
"commandLineArgs": "$(SolutionDir)/../dist/generator/Microsoft.TypeSpec.Generator.dll $(SolutionDir)/TestProjects/Spector/http/type/union/discriminated -g AzureStubGenerator",
370+
"commandName": "Executable",
371+
"executablePath": "dotnet"
342372
}
343373
}
344374
}

eng/packages/http-client-csharp/generator/Azure.Generator/src/Providers/Abstraction/AzureClientResponseProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public override TypeProvider CreateClientCollectionResultDefinition(ClientProvid
3636
CSharpType? type,
3737
bool isAsync)
3838
{
39-
return new CollectionResultDefinition(client, serviceMethod, type, isAsync);
39+
return new AzureCollectionResultDefinition(client, serviceMethod, type, isAsync);
4040
}
4141

4242
public override CSharpType ClientResponseExceptionType => typeof(RequestFailedException);

0 commit comments

Comments
 (0)