@@ -20,6 +20,11 @@ describe('TypeScriptGenerator', () => {
2020 tuple_type_with_additional_items : { type : 'array' , items : [ { type : 'string' } , { type : 'number' } ] , additionalItems : true } ,
2121 array_type : { type : 'array' , items : { type : 'string' } } ,
2222 } ,
23+ patternProperties : {
24+ '^S(.?*)test&' : {
25+ type : 'string'
26+ }
27+ } ,
2328 required : [ 'street_name' , 'city' , 'state' , 'house_number' , 'array_type' ] ,
2429 } ;
2530 const expected = `export class Address {
@@ -33,6 +38,7 @@ describe('TypeScriptGenerator', () => {
3338 private _tupleTypeWithAdditionalItems?: [string, number, ...(object | string | number | Array<unknown> | boolean | null | number)[]];
3439 private _arrayType: Array<string>;
3540 private _additionalProperties?: Map<String, object | string | number | Array<unknown> | boolean | null | number>;
41+ private _sTestPatternProperties?: Map<String, string>;
3642
3743 constructor(input: {
3844 streetName: string,
@@ -85,6 +91,9 @@ describe('TypeScriptGenerator', () => {
8591
8692 get additionalProperties(): Map<String, object | string | number | Array<unknown> | boolean | null | number> | undefined { return this._additionalProperties; }
8793 set additionalProperties(additionalProperties: Map<String, object | string | number | Array<unknown> | boolean | null | number> | undefined) { this._additionalProperties = additionalProperties; }
94+
95+ get sTestPatternProperties(): Map<String, string> | undefined { return this._sTestPatternProperties; }
96+ set sTestPatternProperties(sTestPatternProperties: Map<String, string> | undefined) { this._sTestPatternProperties = sTestPatternProperties; }
8897}` ;
8998
9099 const inputModel = await generator . process ( doc ) ;
@@ -160,6 +169,11 @@ ${content}`;
160169 tuple_type_with_additional_items : { type : 'array' , items : [ { type : 'string' } , { type : 'number' } ] , additionalItems : true } ,
161170 array_type : { type : 'array' , items : { type : 'string' } } ,
162171 } ,
172+ patternProperties : {
173+ '^S(.?*)test&' : {
174+ type : 'string'
175+ }
176+ } ,
163177 required : [ 'street_name' , 'city' , 'state' , 'house_number' , 'array_type' ] ,
164178 } ;
165179 const expected = `export interface Address {
@@ -173,6 +187,7 @@ ${content}`;
173187 tupleTypeWithAdditionalItems?: [string, number, ...(object | string | number | Array<unknown> | boolean | null | number)[]];
174188 arrayType: Array<string>;
175189 additionalProperties?: Map<String, object | string | number | Array<unknown> | boolean | null | number>;
190+ sTestPatternProperties?: Map<String, string>;
176191}` ;
177192
178193 const interfaceGenerator = new TypeScriptGenerator ( { modelType : 'interface' } ) ;
0 commit comments