Skip to content

Commit 2237506

Browse files
authored
Update @typespec/http-client-csharp to 1.0.0-alpha.20250722.1 (#620)
1 parent 18425c2 commit 2237506

File tree

183 files changed

+1322
-453
lines changed

Some content is hidden

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

183 files changed

+1322
-453
lines changed

api/OpenAI.net8.0.cs

Lines changed: 56 additions & 1 deletion
Large diffs are not rendered by default.

api/OpenAI.netstandard2.0.cs

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

codegen/generator/src/OpenAI.Library.Plugin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250626.7" />
11+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20250722.1" />
1212
</ItemGroup>
1313

1414
<!-- Copy output to package dist path for local execution and -->

codegen/generator/src/Visitors/OmittedTypesVisitor.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using Microsoft.TypeSpec.Generator.ClientModel;
2+
using Microsoft.TypeSpec.Generator.Expressions;
23
using Microsoft.TypeSpec.Generator.Providers;
4+
using Microsoft.TypeSpec.Generator.Statements;
35
using System.Collections.Generic;
46
using System.Linq;
57

@@ -20,10 +22,29 @@ public class OmittedTypesVisitor : ScmLibraryVisitor
2022

2123
protected override TypeProvider? VisitType(TypeProvider type)
2224
{
23-
if (TypeNamesToOmit.Any(typeName => type.Name == typeName))
25+
// Strip buildable attributes for omitted types from OpenAIContext
26+
if (type.Name == "OpenAIContext")
2427
{
25-
return null;
28+
var filtered = new List<AttributeStatement>(type.Attributes.Count);
29+
foreach (var a in type.Attributes)
30+
{
31+
bool drop =
32+
a.Type.Name == "ModelReaderWriterBuildableAttribute" &&
33+
a.Arguments.Count == 1 &&
34+
a.Arguments[0] is TypeOfExpression tof &&
35+
TypeNamesToOmit.Contains(tof.Type.Name);
36+
37+
if (!drop) filtered.Add(a);
38+
}
39+
40+
if (filtered.Count != type.Attributes.Count)
41+
type.Update(attributes: filtered);
2642
}
27-
return type;
43+
44+
// Omit the types themselves
45+
if (TypeNamesToOmit.Contains(type.Name))
46+
return null;
47+
48+
return base.VisitType(type);
2849
}
2950
}

codegen/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
],
3030
"dependencies": {
3131
"@open-ai/plugin": "file:",
32-
"@azure-tools/typespec-client-generator-core": "~0.57.0",
33-
"@typespec/http-client-csharp": "1.0.0-alpha.20250626.7"
32+
"@azure-tools/typespec-client-generator-core": "0.57.2",
33+
"@azure-tools/typespec-azure-core": "0.57.0",
34+
"@typespec/http-client-csharp": "1.0.0-alpha.20250722.1",
35+
"@typespec/http": "1.1.0",
36+
"@typespec/openapi": "1.1.0"
3437
},
3538
"devDependencies": {
3639
"@types/node": "^22.8.1",

0 commit comments

Comments
 (0)