prismadoc 1.0.37 → 1.0.38

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.
@@ -170,11 +170,16 @@ export class DocGenField {
170
170
  if (this.isArray) {
171
171
  return `${this.type}[]`;
172
172
  }
173
+ else if (!this.isRequired && this.fieldType === "res") {
174
+ return `${this.type} | null`;
175
+ }
173
176
  else {
174
177
  return this.type;
175
178
  }
176
179
  };
177
- const optionalFlag = this.isRequired ? "!" : "?";
180
+ let optionalFlag = "?";
181
+ if (this.isRequired || this.fieldType === "res")
182
+ optionalFlag = "!";
178
183
  const validators = this.sanitizeValidators();
179
184
  const apiExample = this.buildApiExample().join(", ");
180
185
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prismadoc",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
4
4
  "description": "Auto generates ApiProperties from schema.prisma",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",