1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . Text . Json ;
3
4
using JsonApiDotNetCore . Configuration ;
4
5
using JsonApiDotNetCore . OpenApi . JsonApiObjects . ResourceObjects ;
5
6
using Microsoft . OpenApi . Models ;
@@ -16,8 +17,8 @@ internal sealed class ResourceObjectSchemaGenerator
16
17
private readonly bool _allowClientGeneratedIds ;
17
18
private readonly Func < ResourceTypeInfo , ResourceFieldObjectSchemaBuilder > _createFieldObjectBuilderFactory ;
18
19
19
- public ResourceObjectSchemaGenerator ( SchemaGenerator defaultSchemaGenerator , IResourceGraph resourceGraph ,
20
- IJsonApiOptions jsonApiOptions , ISchemaRepositoryAccessor schemaRepositoryAccessor )
20
+ public ResourceObjectSchemaGenerator ( SchemaGenerator defaultSchemaGenerator , IResourceGraph resourceGraph , IJsonApiOptions jsonApiOptions ,
21
+ ISchemaRepositoryAccessor schemaRepositoryAccessor )
21
22
{
22
23
ArgumentGuard . NotNull ( defaultSchemaGenerator , nameof ( defaultSchemaGenerator ) ) ;
23
24
ArgumentGuard . NotNull ( resourceGraph , nameof ( resourceGraph ) ) ;
@@ -31,15 +32,15 @@ public ResourceObjectSchemaGenerator(SchemaGenerator defaultSchemaGenerator, IRe
31
32
_resourceTypeSchemaGenerator = new ResourceTypeSchemaGenerator ( schemaRepositoryAccessor , resourceGraph ) ;
32
33
_allowClientGeneratedIds = jsonApiOptions . AllowClientGeneratedIds ;
33
34
34
- _createFieldObjectBuilderFactory = CreateFieldObjectBuilderFactory ( defaultSchemaGenerator , resourceGraph , jsonApiOptions ,
35
- schemaRepositoryAccessor , _resourceTypeSchemaGenerator ) ;
35
+ _createFieldObjectBuilderFactory = CreateFieldObjectBuilderFactory ( defaultSchemaGenerator , resourceGraph , jsonApiOptions , schemaRepositoryAccessor ,
36
+ _resourceTypeSchemaGenerator ) ;
36
37
}
37
38
38
39
private static Func < ResourceTypeInfo , ResourceFieldObjectSchemaBuilder > CreateFieldObjectBuilderFactory ( SchemaGenerator defaultSchemaGenerator ,
39
40
IResourceGraph resourceGraph , IJsonApiOptions jsonApiOptions , ISchemaRepositoryAccessor schemaRepositoryAccessor ,
40
41
ResourceTypeSchemaGenerator resourceTypeSchemaGenerator )
41
42
{
42
- var namingPolicy = jsonApiOptions . SerializerOptions . PropertyNamingPolicy ;
43
+ JsonNamingPolicy namingPolicy = jsonApiOptions . SerializerOptions . PropertyNamingPolicy ;
43
44
ResourceNameFormatter resourceNameFormatter = new ( namingPolicy ) ;
44
45
var jsonApiSchemaIdSelector = new JsonApiSchemaIdSelector ( resourceNameFormatter , resourceGraph ) ;
45
46
0 commit comments