openapi-ts-generator 5.223.14 → 5.225.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-generator",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.225.2",
|
|
4
4
|
"description": "Based on swagger-ts-generator, this is a type script model generator specifically for services with OpenApi spec documentation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
* For issues or feature request, visit the repo: https://github.com/ikemtz/openapi-ts-generator
|
|
7
7
|
* Do not edit.
|
|
8
8
|
*/
|
|
9
|
-
import { FormControl, FormArray, FormGroup, Validators } from '@angular/forms'; //NOSONAR{{#if importTypes}}{{#importTypes}}{{#unless
|
|
9
|
+
import { FormControl, FormArray, FormGroup, Validators } from '@angular/forms'; //NOSONAR{{#if importTypes}}{{#importTypes}}{{#unless isSelfReferencing}}{{#if isEnum}}
|
|
10
10
|
import { {{name}} } from './{{kebabCasedTypeName}}.enum';{{else}}
|
|
11
|
-
import { I{{name}} } from './{{kebabCasedTypeName}}.
|
|
12
|
-
import { I{{name}}Form } from './{{kebabCasedTypeName}}.form-group-fac';{{/if}}{{/importTypes}}{{/if}}
|
|
11
|
+
import { I{{name}}Form } from './{{kebabCasedTypeName}}.form-group-fac';{{/if}}{{/unless}}{{/importTypes}}{{/if}}
|
|
13
12
|
|
|
14
13
|
export interface I{{name}}Form {
|
|
15
14
|
{{#valueProperties}}
|
|
@@ -22,8 +21,10 @@ export interface I{{name}}Form {
|
|
|
22
21
|
{{#referenceProperties}}
|
|
23
22
|
{{#if isArray}}
|
|
24
23
|
{{name}}: FormArray<FormGroup<I{{typeScriptType}}Form>>;
|
|
25
|
-
{{else}}
|
|
26
|
-
{{name}}: FormControl<{{
|
|
24
|
+
{{else if isEnum}}
|
|
25
|
+
{{name}}: FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}>;
|
|
26
|
+
{{else}}
|
|
27
|
+
{{name}}: FormGroup<I{{typeScriptType}}Form{{#unless required}} | null{{/unless}}>;
|
|
27
28
|
{{/if}}
|
|
28
29
|
{{/referenceProperties}}
|
|
29
30
|
}
|
|
@@ -52,11 +53,17 @@ export function {{name}}FormGroupFac(): FormGroup<I{{name}}Form> {
|
|
|
52
53
|
{{else}}
|
|
53
54
|
{{name}}: new FormArray<FormGroup<I{{typeScriptType}}Form>>([]{{#if hasValidators}}, { validators: {{#if required}}Validators.required{{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}} } {{/if}}),
|
|
54
55
|
{{/if}}
|
|
56
|
+
{{else if isEnum}}
|
|
57
|
+
{{#if hasMultipleValidators}}
|
|
58
|
+
{{name}}: new FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}>({{{initialValue}}}, { validators: Validators.compose([{{#if required}}Validators.required, {{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}}]){{#if required}}, nonNullable: true{{/if}} }),
|
|
59
|
+
{{else}}
|
|
60
|
+
{{name}}: new FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}>({{{initialValue}}}{{#if hasValidators}}, { validators: {{#if required}}Validators.required{{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}}{{#if required}}, nonNullable: true{{/if}} } {{/if}}),
|
|
61
|
+
{{/if}}
|
|
55
62
|
{{else}}
|
|
56
63
|
{{#if hasMultipleValidators}}
|
|
57
|
-
{{name}}: new
|
|
64
|
+
{{name}}: new FormGroup<I{{typeScriptType}}Form{{#unless required}} | null{{/unless}}>({{{initialValue}}}, { validators: Validators.compose([{{#if required}}Validators.required, {{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}}]){{#if required}}, nonNullable: true{{/if}} }),
|
|
58
65
|
{{else}}
|
|
59
|
-
{{name}}: new
|
|
66
|
+
{{name}}: new FormGroup<I{{typeScriptType}}Form{{#unless required}} | null{{/unless}}>({{{initialValue}}}{{#if hasValidators}}, { validators: {{#if required}}Validators.required{{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}}{{#if required}}, nonNullable: true{{/if}} } {{/if}}),
|
|
60
67
|
{{/if}}
|
|
61
68
|
{{/if}}
|
|
62
69
|
{{/referenceProperties}}
|
package/templates/model.ts.hbs
CHANGED
|
@@ -18,9 +18,9 @@ export interface I{{{name}}} {
|
|
|
18
18
|
* {{description}}
|
|
19
19
|
*/
|
|
20
20
|
{{/if}}
|
|
21
|
-
{{name}}?: {{typeScriptType}}{{#if isArray}}[]{{/if}} | null;
|
|
21
|
+
{{name}}?: {{typeScriptType}}{{#if isArray}}[]{{/if}}{{#unless required}} | null{{/unless}};
|
|
22
22
|
{{/valueProperties}}
|
|
23
23
|
{{#referenceProperties}}
|
|
24
|
-
{{name}}?: {{#unless isEnum}}I{{/unless}}{{referenceTypeName}}{{#if isArray}}[]{{/if}} | null
|
|
24
|
+
{{name}}?: {{#unless isEnum}}I{{/unless}}{{referenceTypeName}}{{#if isArray}}[]{{/if}}{{#unless required}} | null{{/unless}};
|
|
25
25
|
{{/referenceProperties}}
|
|
26
26
|
}
|