nest-prisma_doc-gen 1.0.11 → 1.0.13
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.
|
@@ -42,7 +42,7 @@ export class DocGenDto {
|
|
|
42
42
|
this.classValidators.add("IsEnum");
|
|
43
43
|
this.imports.add(`import { ${Array.from(this.enums)} } from '@prisma/client';`);
|
|
44
44
|
}
|
|
45
|
-
this.imports.add(`import { ${Array.from(this.classValidators)} } from 'src/
|
|
45
|
+
this.imports.add(`import { ${Array.from(this.classValidators)} } from 'src/_core/validators';`);
|
|
46
46
|
return [
|
|
47
47
|
`${Array.from(this.imports).join("\n")}`,
|
|
48
48
|
`export class ${this.name}Dto {
|
package/dist/entities/field.js
CHANGED
|
@@ -108,7 +108,7 @@ export class DocGenField {
|
|
|
108
108
|
props.push(`example: true`);
|
|
109
109
|
}
|
|
110
110
|
else if (this.scalarField.kind === "enum") {
|
|
111
|
-
props.push(`example: ${this.scalarField.type}[0]`);
|
|
111
|
+
props.push(`example: Object.values(${this.scalarField.type})[0]`);
|
|
112
112
|
}
|
|
113
113
|
else if (this.scalarField.type === "Int") {
|
|
114
114
|
props.push(`example: 777`);
|
|
@@ -154,7 +154,7 @@ export class DocGenField {
|
|
|
154
154
|
return this.type;
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
|
-
const optionalFlag = this.isRequired ? "" : "?";
|
|
157
|
+
const optionalFlag = this.isRequired ? "!" : "?";
|
|
158
158
|
const validators = this.sanitizeValidators();
|
|
159
159
|
const apiExample = this.buildApiExample().join(", ");
|
|
160
160
|
return {
|
package/dist/main.js
CHANGED