Skip to content

Commit 9f4d5cb

Browse files
github-actions[bot]actions-userJoshLove-msft
authored
Update @typespec/http-client-csharp to 1.0.0-alpha.20251110.1 (#824)
* Update @typespec/http-client-csharp to 1.0.0-alpha.20251107.3 - Updated @typespec/http-client-csharp from 1.0.0-alpha.20251031.1 to 1.0.0-alpha.20251107.3 - Updated Microsoft.TypeSpec.Generator.ClientModel from 1.0.0-alpha.20251031.1 to 1.0.0-alpha.20251107.3 - Regenerated OpenAI SDK code with new generator version - Updated centrally managed package-lock.json file with new dependency versions * regen * regen --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: jolov <jolov@microsoft.com>
1 parent c8b7cf7 commit 9f4d5cb

File tree

954 files changed

+2465
-1132
lines changed

Some content is hidden

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

954 files changed

+2465
-1132
lines changed

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.20251031.1" />
11+
<PackageReference Include="Microsoft.TypeSpec.Generator.ClientModel" Version="1.0.0-alpha.20251111.2" />
1212
</ItemGroup>
1313

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

codegen/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@open-ai/plugin": "file:",
3232
"@azure-tools/typespec-client-generator-core": "0.61.0",
33-
"@typespec/http-client-csharp": "1.0.0-alpha.20251031.1",
33+
"@typespec/http-client-csharp": "1.0.0-alpha.20251111.2",
3434
"@typespec/http": "1.5.0",
3535
"@typespec/openapi": "1.5.0"
3636
},

package-lock.json

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

src/Generated/Internal/ClientUriBuilder.cs

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ namespace OpenAI
1212
internal partial class ClientUriBuilder
1313
{
1414
private UriBuilder _uriBuilder;
15-
private StringBuilder _pathBuilder;
16-
private StringBuilder _queryBuilder;
15+
private StringBuilder _pathAndQuery;
16+
private int _pathLength;
1717

1818
public ClientUriBuilder()
1919
{
2020
}
2121

22-
private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder();
22+
private UriBuilder UriBuilder => _uriBuilder ??= new UriBuilder();
2323

24-
private StringBuilder PathBuilder => _pathBuilder ??= new StringBuilder(UriBuilder.Path);
25-
26-
private StringBuilder QueryBuilder => _queryBuilder ??= new StringBuilder(UriBuilder.Query);
24+
private StringBuilder PathAndQuery => _pathAndQuery ??= new StringBuilder();
2725

2826
public void Reset(Uri uri)
2927
{
3028
_uriBuilder = new UriBuilder(uri);
31-
_pathBuilder = new StringBuilder(UriBuilder.Path);
32-
_queryBuilder = new StringBuilder(UriBuilder.Query);
29+
PathAndQuery.Clear();
30+
PathAndQuery.Append(UriBuilder.Path);
31+
_pathLength = PathAndQuery.Length;
3332
}
3433

3534
public void AppendPath(string value, bool escape)
@@ -38,12 +37,13 @@ public void AppendPath(string value, bool escape)
3837
{
3938
value = Uri.EscapeDataString(value);
4039
}
41-
if (PathBuilder.Length > 0 && PathBuilder[PathBuilder.Length - 1] == '/' && value[0] == '/')
40+
if (_pathLength > 0 && PathAndQuery[_pathLength - 1] == '/' && value[0] == '/')
4241
{
43-
PathBuilder.Remove(PathBuilder.Length - 1, 1);
42+
PathAndQuery.Remove(_pathLength - 1, 1);
43+
_pathLength = _pathLength - 1;
4444
}
45-
PathBuilder.Append(value);
46-
UriBuilder.Path = PathBuilder.ToString();
45+
PathAndQuery.Insert(_pathLength, value);
46+
_pathLength = _pathLength + value.Length;
4747
}
4848

4949
public void AppendPath(bool value, bool escape = false) => AppendPath(TypeFormatters.ConvertToString(value), escape);
@@ -73,17 +73,21 @@ public void AppendPathDelimited<T>(IEnumerable<T> value, string delimiter, Seria
7373

7474
public void AppendQuery(string name, string value, bool escape)
7575
{
76-
if (QueryBuilder.Length > 0)
76+
if (PathAndQuery.Length == _pathLength)
77+
{
78+
PathAndQuery.Append('?');
79+
}
80+
if (PathAndQuery.Length > _pathLength && PathAndQuery[PathAndQuery.Length - 1] != '?')
7781
{
78-
QueryBuilder.Append('&');
82+
PathAndQuery.Append('&');
7983
}
8084
if (escape)
8185
{
8286
value = Uri.EscapeDataString(value);
8387
}
84-
QueryBuilder.Append(name);
85-
QueryBuilder.Append('=');
86-
QueryBuilder.Append(value);
88+
PathAndQuery.Append(name);
89+
PathAndQuery.Append('=');
90+
PathAndQuery.Append(value);
8791
}
8892

8993
public void AppendQuery(string name, bool value, bool escape = false) => AppendQuery(name, TypeFormatters.ConvertToString(value), escape);
@@ -117,13 +121,14 @@ public void AppendQueryDelimited<T>(string name, IEnumerable<T> value, string de
117121

118122
public Uri ToUri()
119123
{
120-
if (_pathBuilder != null)
124+
UriBuilder.Path = PathAndQuery.ToString(0, _pathLength);
125+
if (PathAndQuery.Length > _pathLength)
121126
{
122-
UriBuilder.Path = _pathBuilder.ToString();
127+
UriBuilder.Query = PathAndQuery.ToString(_pathLength + 1, PathAndQuery.Length - _pathLength - 1);
123128
}
124-
if (_queryBuilder != null)
129+
if (PathAndQuery.Length == _pathLength)
125130
{
126-
UriBuilder.Query = _queryBuilder.ToString();
131+
UriBuilder.Query = "";
127132
}
128133
return UriBuilder.Uri;
129134
}

src/Generated/Internal/CodeGenSerializationAttribute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ public CodeGenSerializationAttribute(string propertyName)
1414
PropertyName = propertyName;
1515
}
1616

17-
public CodeGenSerializationAttribute(string propertyName, string propertySerializationName)
17+
public CodeGenSerializationAttribute(string propertyName, string serializationName)
1818
{
1919
PropertyName = propertyName;
20-
PropertySerializationName = propertySerializationName;
20+
SerializationName = serializationName;
2121
}
2222

2323
public string PropertyName { get; }
2424

25-
public string PropertySerializationName { get; set; }
25+
public string SerializationName { get; set; }
2626

2727
public string SerializationValueHook { get; set; }
2828

src/Generated/Models/Assistants/Assistant.Serialization.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ protected virtual Assistant PersistableModelCreateCore(BinaryData data, ModelRea
356356
switch (format)
357357
{
358358
case "J":
359-
using (JsonDocument document = JsonDocument.Parse(data))
359+
using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
360360
{
361361
return DeserializeAssistant(document.RootElement, options);
362362
}
@@ -370,7 +370,7 @@ protected virtual Assistant PersistableModelCreateCore(BinaryData data, ModelRea
370370
public static explicit operator Assistant(ClientResult result)
371371
{
372372
PipelineResponse response = result.GetRawResponse();
373-
using JsonDocument document = JsonDocument.Parse(response.Content);
373+
using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
374374
return DeserializeAssistant(document.RootElement, ModelSerializationExtensions.WireOptions);
375375
}
376376
}

src/Generated/Models/Assistants/AssistantCollectionOptions.Serialization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected virtual AssistantCollectionOptions PersistableModelCreateCore(BinaryDa
102102
switch (format)
103103
{
104104
case "J":
105-
using (JsonDocument document = JsonDocument.Parse(data))
105+
using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
106106
{
107107
return DeserializeAssistantCollectionOptions(document.RootElement, options);
108108
}

src/Generated/Models/Assistants/AssistantCreationOptions.Serialization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ protected virtual AssistantCreationOptions PersistableModelCreateCore(BinaryData
317317
switch (format)
318318
{
319319
case "J":
320-
using (JsonDocument document = JsonDocument.Parse(data))
320+
using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
321321
{
322322
return DeserializeAssistantCreationOptions(document.RootElement, options);
323323
}

src/Generated/Models/Assistants/AssistantDeletionResult.Serialization.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected virtual AssistantDeletionResult PersistableModelCreateCore(BinaryData
136136
switch (format)
137137
{
138138
case "J":
139-
using (JsonDocument document = JsonDocument.Parse(data))
139+
using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
140140
{
141141
return DeserializeAssistantDeletionResult(document.RootElement, options);
142142
}
@@ -150,7 +150,7 @@ protected virtual AssistantDeletionResult PersistableModelCreateCore(BinaryData
150150
public static explicit operator AssistantDeletionResult(ClientResult result)
151151
{
152152
PipelineResponse response = result.GetRawResponse();
153-
using JsonDocument document = JsonDocument.Parse(response.Content);
153+
using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
154154
return DeserializeAssistantDeletionResult(document.RootElement, ModelSerializationExtensions.WireOptions);
155155
}
156156
}

src/Generated/Models/Assistants/AssistantModificationOptions.Serialization.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ protected virtual AssistantModificationOptions PersistableModelCreateCore(Binary
313313
switch (format)
314314
{
315315
case "J":
316-
using (JsonDocument document = JsonDocument.Parse(data))
316+
using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions))
317317
{
318318
return DeserializeAssistantModificationOptions(document.RootElement, options);
319319
}

0 commit comments

Comments
 (0)