Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fbfdf56

Browse files
committedSep 17, 2021
Replaced OperatingAirplane with Purser, added to many relationship to new model Passenger
1 parent 8ceff7b commit fbfdf56

File tree

9 files changed

+353
-238
lines changed

9 files changed

+353
-238
lines changed
 

‎test/OpenApiClientTests/LegacyClient/RequestTests.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public async Task Partial_posting_resource_with_selected_relationships_produces_
6767
Type = FlightsResourceType.Flights,
6868
Relationships = new FlightRelationshipsInPostRequest
6969
{
70-
OperatingAirplane = new ToOneAirplaneRequestData()
70+
Purser = new ToOneFlightAttendantRequestData()
7171
}
7272
}
7373
};
@@ -87,7 +87,7 @@ public async Task Partial_posting_resource_with_selected_relationships_produces_
8787
""data"": {
8888
""type"": ""flights"",
8989
""relationships"": {
90-
""operating-airplane"": {
90+
""purser"": {
9191
""data"": null
9292
}
9393
}
@@ -113,7 +113,7 @@ public async Task Partial_posting_resource_produces_expected_request()
113113
capitalLWithStroke
114114
});
115115

116-
string name = "anAirplaneName " + specialCharacters;
116+
string name = "purserName " + specialCharacters;
117117

118118
var requestDocument = new AirplanePostRequestDocument
119119
{
@@ -138,14 +138,14 @@ public async Task Partial_posting_resource_produces_expected_request()
138138
// Assert
139139
wrapper.Request.Headers.GetValue(HeaderNames.Accept).Should().Be(HeaderConstants.MediaType);
140140
wrapper.Request.Method.Should().Be(HttpMethod.Post);
141-
wrapper.Request.RequestUri.Should().Be(HostPrefix + "airplanes");
141+
wrapper.Request.RequestUri.Should().Be(HostPrefix + "pursers");
142142
wrapper.Request.Content.Should().NotBeNull();
143143
wrapper.Request.Content!.Headers.ContentType.Should().NotBeNull();
144144
wrapper.Request.Content!.Headers.ContentType!.ToString().Should().Be(HeaderConstants.MediaType);
145145

146146
wrapper.RequestBody.Should().BeJson(@"{
147147
""data"": {
148-
""type"": ""airplanes"",
148+
""type"": ""pursers"",
149149
""attributes"": {
150150
""name"": """ + name + @""",
151151
""serial-number"": null,
@@ -189,14 +189,14 @@ public async Task Partial_patching_resource_produces_expected_request()
189189
// Assert
190190
wrapper.Request.Headers.GetValue(HeaderNames.Accept).Should().Be(HeaderConstants.MediaType);
191191
wrapper.Request.Method.Should().Be(HttpMethod.Patch);
192-
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"airplanes/{airplaneId}");
192+
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"pursers/{airplaneId}");
193193
wrapper.Request.Content.Should().NotBeNull();
194194
wrapper.Request.Content!.Headers.ContentType.Should().NotBeNull();
195195
wrapper.Request.Content!.Headers.ContentType!.ToString().Should().Be(HeaderConstants.MediaType);
196196

197197
wrapper.RequestBody.Should().BeJson(@"{
198198
""data"": {
199-
""type"": ""airplanes"",
199+
""type"": ""pursers"",
200200
""id"": ""XUuiP"",
201201
""attributes"": {
202202
""serial-number"": null,
@@ -236,12 +236,12 @@ public async Task Getting_secondary_resource_produces_expected_request()
236236
IOpenApiClient openApiClient = new OpenApiClient(wrapper.HttpClient);
237237

238238
// Act
239-
_ = await ApiResponse.TranslateAsync(async () => await openApiClient.GetFlightOperatingAirplaneAsync(flightId));
239+
_ = await ApiResponse.TranslateAsync(async () => await openApiClient.GetFlightPurserAsync(flightId));
240240

241241
// Assert
242242
wrapper.Request.Headers.GetValue(HeaderNames.Accept).Should().Be(HeaderConstants.MediaType);
243243
wrapper.Request.Method.Should().Be(HttpMethod.Get);
244-
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"flights/{flightId}/operating-airplane");
244+
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"flights/{flightId}/purser");
245245
wrapper.RequestBody.Should().BeNull();
246246
}
247247

@@ -274,12 +274,12 @@ public async Task Getting_ToOne_relationship_produces_expected_request()
274274
IOpenApiClient openApiClient = new OpenApiClient(wrapper.HttpClient);
275275

276276
// Act
277-
_ = await ApiResponse.TranslateAsync(async () => await openApiClient.GetFlightOperatingAirplaneRelationshipAsync(flightId));
277+
_ = await ApiResponse.TranslateAsync(async () => await openApiClient.GetFlightPurserRelationshipAsync(flightId));
278278

279279
// Assert
280280
wrapper.Request.Headers.GetValue(HeaderNames.Accept).Should().Be(HeaderConstants.MediaType);
281281
wrapper.Request.Method.Should().Be(HttpMethod.Get);
282-
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"flights/{flightId}/relationships/operating-airplane");
282+
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"flights/{flightId}/relationships/purser");
283283
wrapper.RequestBody.Should().BeNull();
284284
}
285285

@@ -292,28 +292,28 @@ public async Task Patching_ToOne_relationship_produces_expected_request()
292292
using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.NoContent, null);
293293
IOpenApiClient openApiClient = new OpenApiClient(wrapper.HttpClient);
294294

295-
var requestDocument = new ToOneAirplaneRequestData
295+
var requestDocument = new ToOneFlightAttendantRequestData
296296
{
297-
Data = new AirplaneIdentifier
297+
Data = new FlightAttendantIdentifier
298298
{
299299
Id = "bBJHu",
300-
Type = AirplanesResourceType.Airplanes
300+
Type = FlightAttendantsResourceType.FlightAttendants
301301
}
302302
};
303303

304304
// Act
305-
await openApiClient.PatchFlightOperatingAirplaneRelationshipAsync(flightId, requestDocument);
305+
await openApiClient.PatchFlightPurserRelationshipAsync(flightId, requestDocument);
306306

307307
// Assert
308308
wrapper.Request.Method.Should().Be(HttpMethod.Patch);
309-
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"flights/{flightId}/relationships/operating-airplane");
309+
wrapper.Request.RequestUri.Should().Be(HostPrefix + $"flights/{flightId}/relationships/purser");
310310
wrapper.Request.Content.Should().NotBeNull();
311311
wrapper.Request.Content!.Headers.ContentType.Should().NotBeNull();
312312
wrapper.Request.Content!.Headers.ContentType!.ToString().Should().Be(HeaderConstants.MediaType);
313313

314314
wrapper.RequestBody.Should().BeJson(@"{
315315
""data"": {
316-
""type"": ""airplanes"",
316+
""type"": ""pursers"",
317317
""id"": ""bBJHu""
318318
}
319319
}");

‎test/OpenApiClientTests/LegacyClient/ResponseTests.cs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public async Task Getting_resource_collection_translates_response()
2727
const string flightDepartsAt = "2014-11-25T00:00:00";
2828
const string documentMetaValue = "1";
2929
const string flightMetaValue = "https://api.jsonapi.net/docs/#get-flights";
30-
const string operatingAirplaneMetaValue = "https://jsonapi.net/api/docs/#get-flight-operating-airplane";
31-
const string cabinPersonnelMetaValue = "https://jsonapi.net/api/docs/#get-flight-cabin-crew-members";
3230
const string purserMetaValue = "https://jsonapi.net/api/docs/#get-flight-purser";
31+
const string cabinPersonnelMetaValue = "https://jsonapi.net/api/docs/#get-flight-cabin-crew-members";
32+
const string passengersMetaValue = "https://jsonapi.net/api/docs/#get-flight-passengers";
3333
const string topLevelLink = HostPrefix + "flights";
3434
const string flightResourceLink = topLevelLink + "/" + flightId;
3535

@@ -59,13 +59,13 @@ public async Task Getting_resource_collection_translates_response()
5959
]
6060
},
6161
""relationships"": {
62-
""operating-airplane"": {
62+
""purser"": {
6363
""links"": {
64-
""self"": """ + flightResourceLink + @"/relationships/operating-airplane"",
65-
""related"": """ + flightResourceLink + @"/operating-airplane""
64+
""self"": """ + flightResourceLink + @"/relationships/purser"",
65+
""related"": """ + flightResourceLink + @"/purser""
6666
},
6767
""meta"": {
68-
""docs"": """ + operatingAirplaneMetaValue + @"""
68+
""docs"": """ + purserMetaValue + @"""
6969
}
7070
},
7171
""cabin-crew-members"": {
@@ -77,13 +77,13 @@ public async Task Getting_resource_collection_translates_response()
7777
""docs"": """ + cabinPersonnelMetaValue + @"""
7878
}
7979
},
80-
""purser"": {
80+
""passengers"": {
8181
""links"": {
82-
""self"": """ + flightResourceLink + @"/relationships/purser"",
83-
""related"": """ + flightResourceLink + @"/purser""
82+
""self"": """ + flightResourceLink + @"/relationships/passengers"",
83+
""related"": """ + flightResourceLink + @"/passengers""
8484
},
8585
""meta"": {
86-
""docs"": """ + purserMetaValue + @"""
86+
""docs"": """ + passengersMetaValue + @"""
8787
}
8888
}
8989
},
@@ -128,23 +128,23 @@ public async Task Getting_resource_collection_translates_response()
128128
flight.Attributes.DepartsAt.Should().Be(DateTimeOffset.Parse(flightDepartsAt, new CultureInfo("en-GB")));
129129
flight.Attributes.ArrivesAt.Should().Be(null);
130130

131-
flight.Relationships.OperatingAirplane.Data.Should().BeNull();
132-
flight.Relationships.OperatingAirplane.Links.Self.Should().Be(flightResourceLink + "/relationships/operating-airplane");
133-
flight.Relationships.OperatingAirplane.Links.Related.Should().Be(flightResourceLink + "/operating-airplane");
134-
flight.Relationships.OperatingAirplane.Meta.Should().HaveCount(1);
135-
flight.Relationships.OperatingAirplane.Meta["docs"].Should().Be(operatingAirplaneMetaValue);
131+
flight.Relationships.Purser.Data.Should().BeNull();
132+
flight.Relationships.Purser.Links.Self.Should().Be(flightResourceLink + "/relationships/purser");
133+
flight.Relationships.Purser.Links.Related.Should().Be(flightResourceLink + "/purser");
134+
flight.Relationships.Purser.Meta.Should().HaveCount(1);
135+
flight.Relationships.Purser.Meta["docs"].Should().Be(purserMetaValue);
136136

137137
flight.Relationships.CabinCrewMembers.Data.Should().BeNull();
138138
flight.Relationships.CabinCrewMembers.Links.Self.Should().Be(flightResourceLink + "/relationships/cabin-crew-members");
139139
flight.Relationships.CabinCrewMembers.Links.Related.Should().Be(flightResourceLink + "/cabin-crew-members");
140140
flight.Relationships.CabinCrewMembers.Meta.Should().HaveCount(1);
141141
flight.Relationships.CabinCrewMembers.Meta["docs"].Should().Be(cabinPersonnelMetaValue);
142142

143-
flight.Relationships.Purser.Data.Should().BeNull();
144-
flight.Relationships.Purser.Links.Self.Should().Be(flightResourceLink + "/relationships/purser");
145-
flight.Relationships.Purser.Links.Related.Should().Be(flightResourceLink + "/purser");
146-
flight.Relationships.Purser.Meta.Should().HaveCount(1);
147-
flight.Relationships.Purser.Meta["docs"].Should().Be(purserMetaValue);
143+
flight.Relationships.Passengers.Data.Should().BeNull();
144+
flight.Relationships.Passengers.Links.Self.Should().Be(flightResourceLink + "/relationships/passengers");
145+
flight.Relationships.Passengers.Links.Related.Should().Be(flightResourceLink + "/passengers");
146+
flight.Relationships.Passengers.Meta.Should().HaveCount(1);
147+
flight.Relationships.Passengers.Meta["docs"].Should().Be(passengersMetaValue);
148148
}
149149

150150
[Fact]
@@ -230,16 +230,16 @@ public async Task Posting_resource_translates_response()
230230

231231
const string responseBody = @"{
232232
""links"": {
233-
""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=operating-airplane,cabin-crew-members,purser""
233+
""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=purser,cabin-crew-members,passengers""
234234
},
235235
""data"": {
236236
""type"": ""flights"",
237237
""id"": """ + flightId + @""",
238238
""relationships"": {
239-
""operating-airplane"": {
239+
""purser"": {
240240
""links"": {
241-
""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/operating-airplane"",
242-
""related"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane""
241+
""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser"",
242+
""related"": """ + HostPrefix + @"flights/" + flightId + @"/purser""
243243
},
244244
""data"": null
245245
},
@@ -255,16 +255,16 @@ public async Task Posting_resource_translates_response()
255255
}
256256
],
257257
},
258-
""purser"": {
258+
""passengers"": {
259259
""links"": {
260-
""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser"",
261-
""related"": """ + HostPrefix + @"flights/" + flightId + @"/purser""
260+
""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/passengers"",
261+
""related"": """ + HostPrefix + @"flights/" + flightId + @"/passengers""
262262
},
263-
""data"": null
263+
""data"": [ ]
264264
}
265265
},
266266
""links"": {
267-
""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=operating-airplane,cabin-crew-members,purser""
267+
""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=purser,cabin-crew-members,passengers""
268268
}
269269
}
270270
}";
@@ -280,12 +280,12 @@ public async Task Posting_resource_translates_response()
280280
Type = FlightsResourceType.Flights,
281281
Relationships = new FlightRelationshipsInPostRequest
282282
{
283-
OperatingAirplane = new ToOneAirplaneRequestData
283+
Purser = new ToOneFlightAttendantRequestData
284284
{
285-
Data = new AirplaneIdentifier
285+
Data = new FlightAttendantIdentifier
286286
{
287287
Id = "XxuIu",
288-
Type = AirplanesResourceType.Airplanes
288+
Type = FlightAttendantsResourceType.FlightAttendants
289289
}
290290
}
291291
}
@@ -294,11 +294,11 @@ public async Task Posting_resource_translates_response()
294294

295295
// Assert
296296
document.Data.Attributes.Should().BeNull();
297-
document.Data.Relationships.OperatingAirplane.Data.Should().BeNull();
297+
document.Data.Relationships.Purser.Data.Should().BeNull();
298298
document.Data.Relationships.CabinCrewMembers.Data.Should().HaveCount(1);
299299
document.Data.Relationships.CabinCrewMembers.Data.First().Id.Should().Be(flightAttendantId);
300300
document.Data.Relationships.CabinCrewMembers.Data.First().Type.Should().Be(FlightAttendantsResourceType.FlightAttendants);
301-
document.Data.Relationships.Purser.Data.Should().BeNull();
301+
document.Data.Relationships.Passengers.Data.Should().BeEmpty();
302302
}
303303

304304
[Fact]
@@ -315,7 +315,7 @@ public async Task Patching_resource_with_side_effects_translates_response()
315315
""type"": ""flights"",
316316
""id"": """ + flightId + @""",
317317
""links"": {
318-
""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=operating-airplane,cabin-crew-members,purser""
318+
""self"": """ + HostPrefix + @"flights/" + flightId + @"&fields[flights]&include=purser,cabin-crew-members,passengers""
319319
}
320320
}
321321
}";
@@ -384,9 +384,9 @@ public async Task Getting_secondary_resource_translates_response()
384384

385385
const string responseBody = @"{
386386
""links"": {
387-
""self"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane"",
388-
""first"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane"",
389-
""last"": """ + HostPrefix + @"flights/" + flightId + @"/operating-airplane""
387+
""self"": """ + HostPrefix + @"flights/" + flightId + @"/purser"",
388+
""first"": """ + HostPrefix + @"flights/" + flightId + @"/purser"",
389+
""last"": """ + HostPrefix + @"flights/" + flightId + @"/purser""
390390
},
391391
""data"": null
392392
}";
@@ -395,7 +395,7 @@ public async Task Getting_secondary_resource_translates_response()
395395
IOpenApiClient openApiClient = new OpenApiClient(wrapper.HttpClient);
396396

397397
// Act
398-
AirplaneSecondaryResponseDocument document = await openApiClient.GetFlightOperatingAirplaneAsync(flightId);
398+
FlightAttendantSecondaryResponseDocument document = await openApiClient.GetFlightPurserAsync(flightId);
399399

400400
// Assert
401401
document.Data.Should().BeNull();
@@ -430,28 +430,28 @@ public async Task Getting_ToOne_relationship_translates_response()
430430
{
431431
// Arrange
432432
const string flightId = "ZvuH1";
433-
const string operatingAirplaneId = "bBJHu";
433+
const string purserId = "bBJHu";
434434

435435
const string responseBody = @"{
436436
""links"": {
437-
""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/operating-airplane"",
438-
""related"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/operating-airplane""
437+
""self"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser"",
438+
""related"": """ + HostPrefix + @"flights/" + flightId + @"/relationships/purser""
439439
},
440440
""data"": {
441-
""type"": ""airplanes"",
442-
""id"": """ + operatingAirplaneId + @"""
441+
""type"": ""flight-attendants"",
442+
""id"": """ + purserId + @"""
443443
}
444444
}";
445445

446446
using var wrapper = FakeHttpClientWrapper.Create(HttpStatusCode.OK, responseBody);
447447
IOpenApiClient openApiClient = new OpenApiClient(wrapper.HttpClient);
448448

449449
// Act
450-
AirplaneIdentifierResponseDocument document = await openApiClient.GetFlightOperatingAirplaneRelationshipAsync(flightId);
450+
FlightAttendantIdentifierResponseDocument document = await openApiClient.GetFlightPurserRelationshipAsync(flightId);
451451

452452
// Assert
453453
document.Data.Should().NotBeNull();
454-
document.Data.Id.Should().Be(operatingAirplaneId);
454+
document.Data.Id.Should().Be(purserId);
455455
document.Data.Type.Should().Be(FlightAttendantsResourceType.FlightAttendants);
456456
}
457457

@@ -463,12 +463,12 @@ public async Task Patching_ToOne_relationship_translates_response()
463463
IOpenApiClient openApiClient = new OpenApiClient(wrapper.HttpClient);
464464

465465
// Act
466-
await openApiClient.PatchFlightOperatingAirplaneRelationshipAsync("ZvuH1", new ToOneAirplaneRequestData
466+
await openApiClient.PatchFlightPurserRelationshipAsync("ZvuH1", new ToOneFlightAttendantRequestData
467467
{
468-
Data = new AirplaneIdentifier
468+
Data = new FlightAttendantIdentifier
469469
{
470470
Id = "Adk2a",
471-
Type = AirplanesResourceType.Airplanes
471+
Type = FlightAttendantsResourceType.FlightAttendants
472472
}
473473
});
474474
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using JetBrains.Annotations;
2+
3+
namespace OpenApiTests.LegacyOpenApiIntegration
4+
{
5+
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
6+
public enum CabinArea
7+
{
8+
FirstClass,
9+
BusinessClass,
10+
EconomyClass
11+
}
12+
}

‎test/OpenApiTests/LegacyOpenApiIntegration/Flight.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public sealed class Flight : Identifiable<string>
3333
public ISet<FlightAttendant> CabinCrewMembers { get; set; }
3434

3535
[HasOne]
36-
public Airplane OperatingAirplane { get; set; }
36+
public FlightAttendant Purser { get; set; }
3737

3838
[Attr]
3939
[NotMapped]
4040
public ICollection<string> ServicesOnBoard { get; set; }
4141

42-
[HasOne]
43-
public FlightAttendant Purser { get; set; }
42+
[HasMany]
43+
public ICollection<Passenger> Passengers { get; set; }
4444
}
4545
}

‎test/OpenApiTests/LegacyOpenApiIntegration/FlightAttendant.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,14 @@
77
namespace OpenApiTests.LegacyOpenApiIntegration
88
{
99
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
10-
public sealed class FlightAttendant : Identifiable<long>
10+
public sealed class FlightAttendant : Identifiable<string>
1111
{
1212
[Attr(Capabilities = AttrCapabilities.AllowView | AttrCapabilities.AllowFilter)]
13-
public override long Id { get; set; }
13+
public override string Id { get; set; }
1414

1515
[Attr(Capabilities = AttrCapabilities.None)]
1616
public FlightAttendantExpertiseLevel ExpertiseLevel { get; set; }
1717

18-
[Attr(PublicName = "document-number", Capabilities = AttrCapabilities.AllowCreate | AttrCapabilities.AllowChange)]
19-
[Required]
20-
[MaxLength(9)]
21-
public string PassportNumber { get; set; }
22-
2318
[Attr(Capabilities = AttrCapabilities.All)]
2419
[Required]
2520
[EmailAddress]

‎test/OpenApiTests/LegacyOpenApiIntegration/FlightAttendantsController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace OpenApiTests.LegacyOpenApiIntegration
77
{
8-
public sealed class FlightAttendantsController : JsonApiController<FlightAttendant, long>
8+
public sealed class FlightAttendantsController : JsonApiController<FlightAttendant, string>
99
{
10-
public FlightAttendantsController(IJsonApiOptions options, ILoggerFactory loggerFactory, IResourceService<FlightAttendant, long> resourceService)
10+
public FlightAttendantsController(IJsonApiOptions options, ILoggerFactory loggerFactory, IResourceService<FlightAttendant, string> resourceService)
1111
: base(options, loggerFactory, resourceService)
1212
{
1313
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.ComponentModel.DataAnnotations;
2+
using JetBrains.Annotations;
3+
using JsonApiDotNetCore.Resources;
4+
using JsonApiDotNetCore.Resources.Annotations;
5+
6+
namespace OpenApiTests.LegacyOpenApiIntegration
7+
{
8+
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
9+
public sealed class Passenger : Identifiable<string>
10+
{
11+
[Attr(PublicName = "document-number", Capabilities = AttrCapabilities.AllowCreate | AttrCapabilities.AllowChange)]
12+
[Required]
13+
[MaxLength(9)]
14+
public string PassportNumber { get; set; }
15+
16+
[Attr]
17+
public string FullName { get; set; }
18+
19+
[Attr]
20+
public CabinArea CabinArea { get; set; }
21+
}
22+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using JsonApiDotNetCore.Configuration;
2+
using JsonApiDotNetCore.Controllers;
3+
using JsonApiDotNetCore.Services;
4+
using Microsoft.Extensions.Logging;
5+
6+
namespace OpenApiTests.LegacyOpenApiIntegration
7+
{
8+
public sealed class PassengersController : JsonApiController<Passenger, string>
9+
{
10+
public PassengersController(IJsonApiOptions options, ILoggerFactory loggerFactory, IResourceService<Passenger, string> resourceService)
11+
: base(options, loggerFactory, resourceService)
12+
{
13+
}
14+
}
15+
}

‎test/OpenApiTests/LegacyOpenApiIntegration/swagger.json

Lines changed: 231 additions & 160 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.