Skip to content

Commit e502a68

Browse files
committed
Fix startup crash, bug is similar to microsoft/kiota#3800
1 parent 6e86686 commit e502a68

File tree

4 files changed

+85
-43
lines changed

4 files changed

+85
-43
lines changed

src/Examples/OpenApiLiblabClientExample/output/csharp/Example/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
var client = new JsonApiDotNetCoreClientExampleClient(config);
1414

15-
var response = await client.People.GetPersonCollectionAsync(new object(), "If-None-Match");
15+
var response = await client.People.GetPersonCollectionAsync();
1616

1717
Console.WriteLine(response);

src/Examples/OpenApiLiblabClientExample/output/csharp/JsonApiDotNetCoreClientExample/Services/PeopleService.cs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public async Task<PersonCollectionResponseDocument> GetPersonCollectionAsync(
2121
)
2222
{
2323
var request = new RequestBuilder(HttpMethod.Get, "api/people")
24-
.SetQueryParameter("query", query)
24+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
25+
//.SetQueryParameter("query", query)
2526
.SetOptionalHeader("If-None-Match", ifNoneMatch)
2627
.Build();
2728

@@ -49,7 +50,8 @@ public async Task<PersonPrimaryResponseDocument> PostPersonAsync(
4950
ArgumentNullException.ThrowIfNull(input, nameof(input));
5051

5152
var request = new RequestBuilder(HttpMethod.Post, "api/people")
52-
.SetQueryParameter("query", query)
53+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
54+
//.SetQueryParameter("query", query)
5355
.SetContentAsJson(input, _jsonSerializerOptions)
5456
.Build();
5557

@@ -76,7 +78,8 @@ public async Task HeadPersonCollectionAsync(
7678
)
7779
{
7880
var request = new RequestBuilder(HttpMethod.Head, "api/people")
79-
.SetQueryParameter("query", query)
81+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
82+
//.SetQueryParameter("query", query)
8083
.SetOptionalHeader("If-None-Match", ifNoneMatch)
8184
.Build();
8285

@@ -100,7 +103,8 @@ public async Task<PersonPrimaryResponseDocument> GetPersonAsync(
100103

101104
var request = new RequestBuilder(HttpMethod.Get, "api/people/{id}")
102105
.SetPathParameter("id", id)
103-
.SetQueryParameter("query", query)
106+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
107+
//.SetQueryParameter("query", query)
104108
.SetOptionalHeader("If-None-Match", ifNoneMatch)
105109
.Build();
106110

@@ -132,7 +136,8 @@ public async Task<PersonPrimaryResponseDocument> PatchPersonAsync(
132136

133137
var request = new RequestBuilder(HttpMethod.Patch, "api/people/{id}")
134138
.SetPathParameter("id", id)
135-
.SetQueryParameter("query", query)
139+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
140+
//.SetQueryParameter("query", query)
136141
.SetContentAsJson(input, _jsonSerializerOptions)
137142
.Build();
138143

@@ -179,7 +184,8 @@ public async Task HeadPersonAsync(
179184

180185
var request = new RequestBuilder(HttpMethod.Head, "api/people/{id}")
181186
.SetPathParameter("id", id)
182-
.SetQueryParameter("query", query)
187+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
188+
//.SetQueryParameter("query", query)
183189
.SetOptionalHeader("If-None-Match", ifNoneMatch)
184190
.Build();
185191

@@ -203,7 +209,8 @@ public async Task<TodoItemCollectionResponseDocument> GetPersonAssignedTodoItems
203209

204210
var request = new RequestBuilder(HttpMethod.Get, "api/people/{id}/assignedTodoItems")
205211
.SetPathParameter("id", id)
206-
.SetQueryParameter("query", query)
212+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
213+
//.SetQueryParameter("query", query)
207214
.SetOptionalHeader("If-None-Match", ifNoneMatch)
208215
.Build();
209216

@@ -235,7 +242,8 @@ public async Task HeadPersonAssignedTodoItemsAsync(
235242

236243
var request = new RequestBuilder(HttpMethod.Head, "api/people/{id}/assignedTodoItems")
237244
.SetPathParameter("id", id)
238-
.SetQueryParameter("query", query)
245+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
246+
//.SetQueryParameter("query", query)
239247
.SetOptionalHeader("If-None-Match", ifNoneMatch)
240248
.Build();
241249

@@ -262,7 +270,8 @@ public async Task<TodoItemIdentifierCollectionResponseDocument> GetPersonAssigne
262270
"api/people/{id}/relationships/assignedTodoItems"
263271
)
264272
.SetPathParameter("id", id)
265-
.SetQueryParameter("query", query)
273+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
274+
//.SetQueryParameter("query", query)
266275
.SetOptionalHeader("If-None-Match", ifNoneMatch)
267276
.Build();
268277

@@ -372,7 +381,8 @@ public async Task HeadPersonAssignedTodoItemsRelationshipAsync(
372381
"api/people/{id}/relationships/assignedTodoItems"
373382
)
374383
.SetPathParameter("id", id)
375-
.SetQueryParameter("query", query)
384+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
385+
//.SetQueryParameter("query", query)
376386
.SetOptionalHeader("If-None-Match", ifNoneMatch)
377387
.Build();
378388

@@ -396,7 +406,8 @@ public async Task<TodoItemCollectionResponseDocument> GetPersonOwnedTodoItemsAsy
396406

397407
var request = new RequestBuilder(HttpMethod.Get, "api/people/{id}/ownedTodoItems")
398408
.SetPathParameter("id", id)
399-
.SetQueryParameter("query", query)
409+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
410+
//.SetQueryParameter("query", query)
400411
.SetOptionalHeader("If-None-Match", ifNoneMatch)
401412
.Build();
402413

@@ -428,7 +439,8 @@ public async Task HeadPersonOwnedTodoItemsAsync(
428439

429440
var request = new RequestBuilder(HttpMethod.Head, "api/people/{id}/ownedTodoItems")
430441
.SetPathParameter("id", id)
431-
.SetQueryParameter("query", query)
442+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
443+
//.SetQueryParameter("query", query)
432444
.SetOptionalHeader("If-None-Match", ifNoneMatch)
433445
.Build();
434446

@@ -455,7 +467,8 @@ public async Task<TodoItemIdentifierCollectionResponseDocument> GetPersonOwnedTo
455467
"api/people/{id}/relationships/ownedTodoItems"
456468
)
457469
.SetPathParameter("id", id)
458-
.SetQueryParameter("query", query)
470+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
471+
//.SetQueryParameter("query", query)
459472
.SetOptionalHeader("If-None-Match", ifNoneMatch)
460473
.Build();
461474

@@ -565,7 +578,8 @@ public async Task HeadPersonOwnedTodoItemsRelationshipAsync(
565578
"api/people/{id}/relationships/ownedTodoItems"
566579
)
567580
.SetPathParameter("id", id)
568-
.SetQueryParameter("query", query)
581+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
582+
//.SetQueryParameter("query", query)
569583
.SetOptionalHeader("If-None-Match", ifNoneMatch)
570584
.Build();
571585

src/Examples/OpenApiLiblabClientExample/output/csharp/JsonApiDotNetCoreClientExample/Services/TagsService.cs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public async Task<TagCollectionResponseDocument> GetTagCollectionAsync(
2121
)
2222
{
2323
var request = new RequestBuilder(HttpMethod.Get, "api/tags")
24-
.SetQueryParameter("query", query)
24+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
25+
//.SetQueryParameter("query", query)
2526
.SetOptionalHeader("If-None-Match", ifNoneMatch)
2627
.Build();
2728

@@ -49,7 +50,8 @@ public async Task<TagPrimaryResponseDocument> PostTagAsync(
4950
ArgumentNullException.ThrowIfNull(input, nameof(input));
5051

5152
var request = new RequestBuilder(HttpMethod.Post, "api/tags")
52-
.SetQueryParameter("query", query)
53+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
54+
//.SetQueryParameter("query", query)
5355
.SetContentAsJson(input, _jsonSerializerOptions)
5456
.Build();
5557

@@ -76,7 +78,8 @@ public async Task HeadTagCollectionAsync(
7678
)
7779
{
7880
var request = new RequestBuilder(HttpMethod.Head, "api/tags")
79-
.SetQueryParameter("query", query)
81+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
82+
//.SetQueryParameter("query", query)
8083
.SetOptionalHeader("If-None-Match", ifNoneMatch)
8184
.Build();
8285

@@ -100,7 +103,8 @@ public async Task<TagPrimaryResponseDocument> GetTagAsync(
100103

101104
var request = new RequestBuilder(HttpMethod.Get, "api/tags/{id}")
102105
.SetPathParameter("id", id)
103-
.SetQueryParameter("query", query)
106+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
107+
//.SetQueryParameter("query", query)
104108
.SetOptionalHeader("If-None-Match", ifNoneMatch)
105109
.Build();
106110

@@ -132,7 +136,8 @@ public async Task<TagPrimaryResponseDocument> PatchTagAsync(
132136

133137
var request = new RequestBuilder(HttpMethod.Patch, "api/tags/{id}")
134138
.SetPathParameter("id", id)
135-
.SetQueryParameter("query", query)
139+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
140+
//.SetQueryParameter("query", query)
136141
.SetContentAsJson(input, _jsonSerializerOptions)
137142
.Build();
138143

@@ -179,7 +184,8 @@ public async Task HeadTagAsync(
179184

180185
var request = new RequestBuilder(HttpMethod.Head, "api/tags/{id}")
181186
.SetPathParameter("id", id)
182-
.SetQueryParameter("query", query)
187+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
188+
//.SetQueryParameter("query", query)
183189
.SetOptionalHeader("If-None-Match", ifNoneMatch)
184190
.Build();
185191

@@ -203,7 +209,8 @@ public async Task<TodoItemCollectionResponseDocument> GetTagTodoItemsAsync(
203209

204210
var request = new RequestBuilder(HttpMethod.Get, "api/tags/{id}/todoItems")
205211
.SetPathParameter("id", id)
206-
.SetQueryParameter("query", query)
212+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
213+
//.SetQueryParameter("query", query)
207214
.SetOptionalHeader("If-None-Match", ifNoneMatch)
208215
.Build();
209216

@@ -235,7 +242,8 @@ public async Task HeadTagTodoItemsAsync(
235242

236243
var request = new RequestBuilder(HttpMethod.Head, "api/tags/{id}/todoItems")
237244
.SetPathParameter("id", id)
238-
.SetQueryParameter("query", query)
245+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
246+
//.SetQueryParameter("query", query)
239247
.SetOptionalHeader("If-None-Match", ifNoneMatch)
240248
.Build();
241249

@@ -259,7 +267,8 @@ public async Task<TodoItemIdentifierCollectionResponseDocument> GetTagTodoItemsR
259267

260268
var request = new RequestBuilder(HttpMethod.Get, "api/tags/{id}/relationships/todoItems")
261269
.SetPathParameter("id", id)
262-
.SetQueryParameter("query", query)
270+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
271+
//.SetQueryParameter("query", query)
263272
.SetOptionalHeader("If-None-Match", ifNoneMatch)
264273
.Build();
265274

@@ -357,7 +366,8 @@ public async Task HeadTagTodoItemsRelationshipAsync(
357366

358367
var request = new RequestBuilder(HttpMethod.Head, "api/tags/{id}/relationships/todoItems")
359368
.SetPathParameter("id", id)
360-
.SetQueryParameter("query", query)
369+
// Commented out to workaround bug: It sends ?query= instead of key-value pairs, resulting in HTTP 400.
370+
//.SetQueryParameter("query", query)
361371
.SetOptionalHeader("If-None-Match", ifNoneMatch)
362372
.Build();
363373

0 commit comments

Comments
 (0)