Skip to content

Commit 3278f14

Browse files
committed
Idk anymore
1 parent ea9c970 commit 3278f14

File tree

17 files changed

+4232
-2515
lines changed

17 files changed

+4232
-2515
lines changed

src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json

Lines changed: 371 additions & 263 deletions
Large diffs are not rendered by default.

src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj

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

2727
<ItemGroup>
2828
<OpenApiReference Include="..\JsonApiDotNetCoreExample\GeneratedSwagger\JsonApiDotNetCoreExample.json" CodeGenerator="NSwagCSharp" ClassName="ExampleApiClient">
29-
<Options>/GenerateExceptionClasses:false /WrapResponses:true /ResponseClass:JsonApiResponse /GenerateOptionalParameters:true /GenerateNullableReferenceTypes:true /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.Exceptions</Options>
29+
<Options>/GenerateExceptionClasses:false /WrapResponses:true /ResponseClass:JsonApiResponse /GenerateOptionalParameters:true /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.Exceptions</Options>
3030
</OpenApiReference>
3131
</ItemGroup>
3232
</Project>

src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiOperationDocumentationFilter.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ private static void SetResponseHeaderContentLength(OpenApiResponses responses, H
490490
Required = true,
491491
Schema = new OpenApiSchema
492492
{
493-
Type = "integer",
493+
Type = "integer"
494494
},
495-
Example = new OpenApiInteger(322),
495+
Example = new OpenApiInteger(891)
496496
};
497497
}
498498

@@ -566,8 +566,7 @@ private static void AddHeaderParameterIfNoneMatch(OpenApiOperation operation)
566566
Schema = new OpenApiSchema
567567
{
568568
Type = "string",
569-
Default = new OpenApiString(null),
570-
Nullable = true,
569+
Nullable = true
571570
},
572571
Example = new OpenApiString("\"33a64df551425fcc55e4d42a148795d9f25f89d4\"")
573572
});

test/OpenApiClientTests/LegacyClient/RequestTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public async Task Getting_resource_collection_produces_expected_request()
2323
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
2424

2525
// Act
26-
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightCollectionAsync(null));
26+
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightCollectionAsync());
2727

2828
// Assert
2929
wrapper.Request.ShouldNotBeNull();
@@ -43,7 +43,7 @@ public async Task Getting_resource_produces_expected_request()
4343
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
4444

4545
// Act
46-
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightAsync(flightId, null));
46+
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightAsync(flightId));
4747

4848
// Assert
4949
wrapper.Request.ShouldNotBeNull();
@@ -269,7 +269,7 @@ public async Task Getting_secondary_resource_produces_expected_request()
269269
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
270270

271271
// Act
272-
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightPurserAsync(flightId, null));
272+
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightPurserAsync(flightId));
273273

274274
// Assert
275275
wrapper.Request.ShouldNotBeNull();
@@ -289,7 +289,7 @@ public async Task Getting_secondary_resources_produces_expected_request()
289289
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
290290

291291
// Act
292-
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightCabinCrewMembersAsync(flightId, null));
292+
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightCabinCrewMembersAsync(flightId));
293293

294294
// Assert
295295
wrapper.Request.ShouldNotBeNull();
@@ -309,7 +309,7 @@ public async Task Getting_ToOne_relationship_produces_expected_request()
309309
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
310310

311311
// Act
312-
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightPurserRelationshipAsync(flightId, null));
312+
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightPurserRelationshipAsync(flightId));
313313

314314
// Assert
315315
wrapper.Request.ShouldNotBeNull();
@@ -368,7 +368,7 @@ public async Task Getting_ToMany_relationship_produces_expected_request()
368368
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
369369

370370
// Act
371-
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightCabinCrewMembersRelationshipAsync(flightId, null));
371+
_ = await ApiResponse.TranslateAsync(() => apiClient.GetFlightCabinCrewMembersRelationshipAsync(flightId));
372372

373373
// Assert
374374
wrapper.Request.ShouldNotBeNull();

test/OpenApiClientTests/LegacyClient/ResponseTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public async Task Getting_resource_collection_translates_response()
9999
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
100100

101101
// Act
102-
FlightCollectionResponseDocument document = await apiClient.GetFlightCollectionAsync(null);
102+
FlightCollectionResponseDocument document = await apiClient.GetFlightCollectionAsync();
103103

104104
// Assert
105105
document.Jsonapi.Should().BeNull();
@@ -180,7 +180,7 @@ public async Task Getting_resource_translates_response()
180180
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
181181

182182
// Act
183-
FlightPrimaryResponseDocument document = await apiClient.GetFlightAsync(flightId, null);
183+
FlightPrimaryResponseDocument document = await apiClient.GetFlightAsync(flightId);
184184

185185
// Assert
186186
document.Jsonapi.Should().BeNull();
@@ -218,7 +218,7 @@ public async Task Getting_unknown_resource_translates_error_response()
218218
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
219219

220220
// Act
221-
Func<Task<FlightPrimaryResponseDocument>> action = () => apiClient.GetFlightAsync(flightId, null);
221+
Func<Task<FlightPrimaryResponseDocument>> action = () => apiClient.GetFlightAsync(flightId);
222222

223223
// Assert
224224
ApiException<ErrorResponseDocument> exception = (await action.Should().ThrowExactlyAsync<ApiException<ErrorResponseDocument>>()).Which;
@@ -447,7 +447,7 @@ public async Task Getting_secondary_resource_translates_response()
447447
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
448448

449449
// Act
450-
FlightAttendantSecondaryResponseDocument document = await apiClient.GetFlightPurserAsync(flightId, null);
450+
FlightAttendantSecondaryResponseDocument document = await apiClient.GetFlightPurserAsync(flightId);
451451

452452
// Assert
453453
document.Data.Should().NotBeNull();
@@ -479,7 +479,7 @@ public async Task Getting_nullable_secondary_resource_translates_response()
479479
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
480480

481481
// Act
482-
NullableFlightAttendantSecondaryResponseDocument document = await apiClient.GetFlightBackupPurserAsync(flightId, null);
482+
NullableFlightAttendantSecondaryResponseDocument document = await apiClient.GetFlightBackupPurserAsync(flightId);
483483

484484
// Assert
485485
document.Data.Should().BeNull();
@@ -505,7 +505,7 @@ public async Task Getting_secondary_resources_translates_response()
505505
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
506506

507507
// Act
508-
FlightAttendantCollectionResponseDocument document = await apiClient.GetFlightCabinCrewMembersAsync(flightId, null);
508+
FlightAttendantCollectionResponseDocument document = await apiClient.GetFlightCabinCrewMembersAsync(flightId);
509509

510510
// Assert
511511
document.Data.Should().BeEmpty();
@@ -531,7 +531,7 @@ public async Task Getting_nullable_ToOne_relationship_translates_response()
531531
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
532532

533533
// Act
534-
NullableFlightAttendantIdentifierResponseDocument document = await apiClient.GetFlightBackupPurserRelationshipAsync(flightId, null);
534+
NullableFlightAttendantIdentifierResponseDocument document = await apiClient.GetFlightBackupPurserRelationshipAsync(flightId);
535535

536536
// Assert
537537
document.Data.Should().BeNull();
@@ -561,7 +561,7 @@ public async Task Getting_ToOne_relationship_translates_response()
561561
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
562562

563563
// Act
564-
FlightAttendantIdentifierResponseDocument document = await apiClient.GetFlightPurserRelationshipAsync(flightId, null);
564+
FlightAttendantIdentifierResponseDocument document = await apiClient.GetFlightPurserRelationshipAsync(flightId);
565565

566566
// Assert
567567
document.Data.Should().NotBeNull();
@@ -617,7 +617,7 @@ public async Task Getting_ToMany_relationship_translates_response()
617617
IOpenApiClient apiClient = new OpenApiClient(wrapper.HttpClient);
618618

619619
// Act
620-
FlightAttendantIdentifierCollectionResponseDocument document = await apiClient.GetFlightCabinCrewMembersRelationshipAsync(flightId, null);
620+
FlightAttendantIdentifierCollectionResponseDocument document = await apiClient.GetFlightCabinCrewMembersRelationshipAsync(flightId);
621621

622622
// Assert
623623
document.Data.Should().HaveCount(2);

0 commit comments

Comments
 (0)