1
1
using JsonApiDotNetCore . Configuration ;
2
2
using JsonApiDotNetCore . OpenApi ;
3
- using JsonApiDotNetCore . Resources . Annotations ;
4
3
using Microsoft . AspNetCore . Builder ;
5
4
using Microsoft . AspNetCore . Hosting ;
6
5
using Microsoft . EntityFrameworkCore ;
7
6
using Microsoft . Extensions . DependencyInjection ;
8
7
using Microsoft . Extensions . Logging ;
9
- using Newtonsoft . Json . Serialization ;
10
8
using TestBuildingBlocks ;
11
9
12
- namespace OpenApiTests
10
+ namespace OpenApiTests . Startups
13
11
{
14
- public sealed class OpenApiStartup < TDbContext > : TestableStartup < TDbContext >
12
+ public abstract class OpenApiStartup < TDbContext > : TestableStartup < TDbContext >
15
13
where TDbContext : DbContext
16
14
{
17
15
public override void ConfigureServices ( IServiceCollection services )
@@ -23,24 +21,6 @@ public override void ConfigureServices(IServiceCollection services)
23
21
services . AddOpenApi ( mvcBuilder ) ;
24
22
}
25
23
26
- protected override void SetJsonApiOptions ( JsonApiOptions options )
27
- {
28
- base . SetJsonApiOptions ( options ) ;
29
-
30
- options . Namespace = "api/v1" ;
31
- options . DefaultPageSize = new PageSize ( 10 ) ;
32
- options . MaximumPageSize = new PageSize ( 100 ) ;
33
- options . MaximumPageNumber = new PageNumber ( 50 ) ;
34
- options . IncludeTotalResourceCount = true ;
35
- options . ValidateModelState = true ;
36
- options . DefaultAttrCapabilities = AttrCapabilities . AllowView ;
37
-
38
- options . SerializerSettings . ContractResolver = new DefaultContractResolver
39
- {
40
- NamingStrategy = new KebabCaseNamingStrategy ( )
41
- } ;
42
- }
43
-
44
24
public override void Configure ( IApplicationBuilder app , IWebHostEnvironment environment , ILoggerFactory loggerFactory )
45
25
{
46
26
app . UseRouting ( ) ;
0 commit comments