openapi-ts-generator 5.258.3 → 5.259.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.259.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",
|
|
@@ -43,11 +43,13 @@ export function {{name}}FormGroupFac(): FormGroup<I{{name}}Form> {
|
|
|
43
43
|
{{name}}: new FormControl<{{typeScriptType}}{{#unless required}} | null| undefined{{/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}}),
|
|
44
44
|
{{/if}}
|
|
45
45
|
{{else}}
|
|
46
|
+
{{#unless isSameAsParentTypescriptType}}
|
|
46
47
|
{{#if hasMultipleValidators}}
|
|
47
|
-
{{name}}: new FormGroup<I{{typeScriptType}}Form>({{#if isSameAsParentTypescriptType}}{
|
|
48
|
+
{{name}}: new FormGroup<I{{typeScriptType}}Form{{#unless required}} | null | undefined{{/unless}}>({{#if isSameAsParentTypescriptType}}null{{else}}{{typeScriptType}}FormGroupFac().controls{{/if}}, { validators: Validators.compose([{{#if required}}Validators.required, {{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}}]) }),
|
|
48
49
|
{{else}}
|
|
49
|
-
{{name}}: new FormGroup<I{{typeScriptType}}Form>({{#if isSameAsParentTypescriptType}}{
|
|
50
|
+
{{name}}: new FormGroup<I{{typeScriptType}}Form{{#unless required}} | null | undefined{{/unless}}>({{#if isSameAsParentTypescriptType}}null{{else}}{{typeScriptType}}FormGroupFac().controls{{/if}}{{#if hasValidators}}, { validators: {{#if required}}Validators.required{{/if}}{{minLengthValidator "referenceProperties"}}{{maxLengthValidator "referenceProperties"}}{{minimumValidator "referenceProperties"}}{{maximumValidator "referenceProperties"}}{{minItemsValidator "referenceProperties"}}{{maxItemsValidator "referenceProperties"}}{{{patternValidator "referenceProperties"}}} } {{/if}}),
|
|
50
51
|
{{/if}}
|
|
52
|
+
{{/unless}}
|
|
51
53
|
{{/if}}
|
|
52
54
|
{{/referenceProperties}}
|
|
53
55
|
});
|
package/templates/form.ts.hbs
CHANGED
|
@@ -24,7 +24,7 @@ export interface I{{name}}Form {
|
|
|
24
24
|
{{else if isEnum}}
|
|
25
25
|
{{name}}: FormControl<{{typeScriptType}}{{#unless required}} | null | undefined{{/unless}}>;
|
|
26
26
|
{{else}}
|
|
27
|
-
{{name}}: FormGroup<I{{typeScriptType}}Form>;
|
|
27
|
+
{{name}}{{#if isSameAsParentTypescriptType}}?{{/if}}: FormGroup<I{{typeScriptType}}Form>;
|
|
28
28
|
{{/if}}
|
|
29
29
|
{{/referenceProperties}}
|
|
30
30
|
}
|