openapi-ts-generator 5.227.4 → 5.232.1
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/openapidoc-converter.js
CHANGED
|
@@ -212,7 +212,7 @@ var OpenApiDocConverter = /** @class */ (function () {
|
|
|
212
212
|
return "'".concat(defaultValue.split(' ').pop(), "'");
|
|
213
213
|
}
|
|
214
214
|
else if (email) {
|
|
215
|
-
return "".concat((0, lodash_1.kebabCase)(parentTypeName), "@email.org");
|
|
215
|
+
return "'".concat((0, lodash_1.kebabCase)(parentTypeName), "@email.org'");
|
|
216
216
|
}
|
|
217
217
|
else if (typescriptType === 'Date') {
|
|
218
218
|
return 'new Date()';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-generator",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.232.1",
|
|
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",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"build": "npm run format && npm run lint && tsc && cp -rfv ./src/templates ./lib",
|
|
9
9
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
10
10
|
"lint": "eslint . --ext .ts --output-file ./eslint-report.json --format json",
|
|
11
|
+
"link": "npm run build && cd lib && npm link && cd ..",
|
|
11
12
|
"test": "npm run build && jest --collect-coverage",
|
|
12
13
|
"prep:lib": "rm -rv ./lib/*.spec.* && rm -rv ./lib/**/*.spec.* && cp -v ./package.json ./lib/ && cp -v ./LICENSE ./lib/ && cp -v ./README.md ./lib/",
|
|
13
14
|
"debug": "npm run build && node --inspect-brk ./lib/app.js"
|
|
@@ -44,9 +44,9 @@ export function {{name}}FormGroupFac(): FormGroup<I{{name}}Form> {
|
|
|
44
44
|
{{/if}}
|
|
45
45
|
{{else}}
|
|
46
46
|
{{#if hasMultipleValidators}}
|
|
47
|
-
{{name}}: new FormGroup<I{{typeScriptType}}Form>({{#if isSameAsParentTypescriptType}}{}{{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"}}}])
|
|
47
|
+
{{name}}: new FormGroup<I{{typeScriptType}}Form>({{#if isSameAsParentTypescriptType}}{}{{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
48
|
{{else}}
|
|
49
|
-
{{name}}: new FormGroup<I{{typeScriptType}}Form>({{#if isSameAsParentTypescriptType}}{}{{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"}}}
|
|
49
|
+
{{name}}: new FormGroup<I{{typeScriptType}}Form>({{#if isSameAsParentTypescriptType}}{}{{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
50
|
{{/if}}
|
|
51
51
|
{{/if}}
|
|
52
52
|
{{/referenceProperties}}
|
package/templates/form.ts.hbs
CHANGED
|
@@ -15,14 +15,14 @@ export interface I{{name}}Form {
|
|
|
15
15
|
{{#if isArray}}
|
|
16
16
|
{{name}}?: FormArray<FormControl<{{typeScriptType}}>>;
|
|
17
17
|
{{else}}
|
|
18
|
-
{{name}}?: FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}
|
|
18
|
+
{{name}}?: FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}>;
|
|
19
19
|
{{/if}}
|
|
20
20
|
{{/valueProperties}}
|
|
21
21
|
{{#referenceProperties}}
|
|
22
22
|
{{#if isArray}}
|
|
23
23
|
{{name}}?: FormArray<FormGroup<I{{typeScriptType}}Form>>;
|
|
24
24
|
{{else if isEnum}}
|
|
25
|
-
{{name}}?: FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}
|
|
25
|
+
{{name}}?: FormControl<{{typeScriptType}}{{#unless required}} | null{{/unless}}>;
|
|
26
26
|
{{else}}
|
|
27
27
|
{{name}}?: FormGroup<I{{typeScriptType}}Form>;
|
|
28
28
|
{{/if}}
|