@@ -8,18 +8,38 @@ export class PrimitiveSchemaParser extends MonoSchemaParser {
88 this . schema || { } ;
99
1010 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+
2040 contentType = this . config . Ts . RecordType (
21- this . config . Ts . Keyword . String ,
22- fieldType ,
41+ recordKeysContent ,
42+ recordValuesContent ,
2343 ) ;
2444 }
2545
0 commit comments