nest-prisma_doc-gen 1.0.5 → 1.0.7
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/dist/entities/field.js +6 -3
- package/dist/utils/helpers.js +1 -1
- package/package.json +1 -2
package/dist/entities/field.js
CHANGED
|
@@ -87,8 +87,6 @@ export class DocGenField {
|
|
|
87
87
|
buildApiExample() {
|
|
88
88
|
const fieldName = this.scalarField.name;
|
|
89
89
|
const props = [];
|
|
90
|
-
const scalarDbName = this.scalarField.dbName ?? "genericDbName";
|
|
91
|
-
console.log(this.scalarField);
|
|
92
90
|
if (this.isEntity) {
|
|
93
91
|
if (this.isList) {
|
|
94
92
|
props.push(`example: [generateExample(${this.type})]`);
|
|
@@ -118,7 +116,12 @@ export class DocGenField {
|
|
|
118
116
|
else if (this.scalarField.type === "String") {
|
|
119
117
|
props.push(`example: 'ordinary string'`);
|
|
120
118
|
}
|
|
121
|
-
|
|
119
|
+
if (this.type === "object") {
|
|
120
|
+
props.push(`additionalProperties: true`);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
props.push(`required: ${this.scalarField.isRequired}`);
|
|
124
|
+
}
|
|
122
125
|
return props;
|
|
123
126
|
}
|
|
124
127
|
sanitizeValidators() {
|
package/dist/utils/helpers.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nest-prisma_doc-gen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Auto generates ApiProperties from schema.prisma",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"author": "Alessandro Lepore",
|
|
29
29
|
"license": "ISC",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@esbuild/win32-x64": "^0.25.11",
|
|
32
31
|
"@prisma/internals": "^6.17.1",
|
|
33
32
|
"ajv": "^8.17.1",
|
|
34
33
|
"ajv-formats": "^3.0.1",
|