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.
@@ -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
- props.push(`required: ${this.scalarField.isRequired}`);
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() {
@@ -17,7 +17,7 @@ export class Helper {
17
17
  case "DateTime":
18
18
  return "Date";
19
19
  case "Json":
20
- return "any";
20
+ return "object";
21
21
  case "Bytes":
22
22
  return "Buffer";
23
23
  default: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nest-prisma_doc-gen",
3
- "version": "1.0.5",
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",