@necessarylion/adonis-autoswagger 0.0.19 → 0.0.20

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.
Files changed (2) hide show
  1. package/dist/schema.js +6 -1
  2. package/package.json +1 -1
package/dist/schema.js CHANGED
@@ -58,11 +58,16 @@ class SchemaService {
58
58
  */
59
59
  async getValidators() {
60
60
  const validators = {};
61
- let p6 = path_1.default.join(this.options.appPath, "validators");
61
+ // support both "validators" and "Validators" folder names
62
+ let p6 = ["validators", "Validators"]
63
+ .map((dir) => path_1.default.join(this.options.appPath, dir))
64
+ .find((p) => (0, fs_2.existsSync)(p)) ?? path_1.default.join(this.options.appPath, "validators");
62
65
  if (typeof this.customPaths["#validators"] !== "undefined") {
63
66
  // it's v6
64
67
  p6 = p6.replaceAll("app/validators", this.customPaths["#validators"]);
65
68
  p6 = p6.replaceAll("app\\validators", this.customPaths["#validators"]);
69
+ p6 = p6.replaceAll("app/Validators", this.customPaths["#validators"]);
70
+ p6 = p6.replaceAll("app\\Validators", this.customPaths["#validators"]);
66
71
  }
67
72
  if (!(0, fs_2.existsSync)(p6)) {
68
73
  if (this.options.debug) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@necessarylion/adonis-autoswagger",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Auto-Generate swagger docs for AdonisJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",