@@ -8,18 +8,38 @@ export class PrimitiveSchemaParser extends MonoSchemaParser {
8
8
this . schema || { } ;
9
9
10
10
if ( type === this . config . Ts . Keyword . Object && additionalProperties ) {
11
- const fieldType =
12
- typeof additionalProperties === "object"
13
- ? this . schemaParserFabric
14
- . createSchemaParser ( {
15
- schema : additionalProperties ,
16
- schemaPath : this . schemaPath ,
17
- } )
18
- . getInlineParseContent ( )
19
- : this . config . Ts . Keyword . Any ;
11
+ const propertyNamesSchema = this . schemaUtils . getSchemaPropertyNamesSchema (
12
+ this . schema ,
13
+ ) ;
14
+
15
+ let recordKeysContent : any ;
16
+ let recordValuesContent : any ;
17
+
18
+ if ( propertyNamesSchema ) {
19
+ recordKeysContent = this . schemaParserFabric
20
+ . createSchemaParser ( {
21
+ schema : propertyNamesSchema ,
22
+ schemaPath : this . schemaPath ,
23
+ } )
24
+ . getInlineParseContent ( ) ;
25
+ } else {
26
+ recordKeysContent = this . config . Ts . Keyword . String ;
27
+ }
28
+
29
+ if ( typeof additionalProperties === "object" ) {
30
+ recordValuesContent = this . schemaParserFabric
31
+ . createSchemaParser ( {
32
+ schema : additionalProperties ,
33
+ schemaPath : this . schemaPath ,
34
+ } )
35
+ . getInlineParseContent ( ) ;
36
+ } else {
37
+ recordValuesContent = this . config . Ts . Keyword . Any ;
38
+ }
39
+
20
40
contentType = this . config . Ts . RecordType (
21
- this . config . Ts . Keyword . String ,
22
- fieldType ,
41
+ recordKeysContent ,
42
+ recordValuesContent ,
23
43
) ;
24
44
}
25
45
0 commit comments