nest-prisma_doc-gen 1.0.6 → 1.0.8

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 '../enums';`);
44
44
  }
45
- this.imports.add(`import { ${Array.from(this.classValidators)} } from 'class-validator';`);
45
+ this.imports.add(`import { ${Array.from(this.classValidators)} } from 'src/utils/validators';`);
46
46
  return [
47
47
  `${Array.from(this.imports).join("\n")}`,
48
48
  `export class ${this.name}Dto {
@@ -116,7 +116,12 @@ export class DocGenField {
116
116
  else if (this.scalarField.type === "String") {
117
117
  props.push(`example: 'ordinary string'`);
118
118
  }
119
- 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
+ }
120
125
  return props;
121
126
  }
122
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.6",
3
+ "version": "1.0.8",
4
4
  "description": "Auto generates ApiProperties from schema.prisma",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",