@necessarylion/adonis-autoswagger 0.0.5 → 0.0.6
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.
|
@@ -166,7 +166,12 @@ class InterfaceParser {
|
|
|
166
166
|
parsedProperties[key] = this.parseType(value, key);
|
|
167
167
|
}
|
|
168
168
|
if (definition.examples[key]) {
|
|
169
|
-
|
|
169
|
+
let example = definition.examples[key];
|
|
170
|
+
if (example === 'true')
|
|
171
|
+
example = true;
|
|
172
|
+
if (example === 'false')
|
|
173
|
+
example = false;
|
|
174
|
+
parsedProperties[key].example = example;
|
|
170
175
|
}
|
|
171
176
|
}
|
|
172
177
|
const schema = {
|
|
@@ -222,7 +227,7 @@ class InterfaceParser {
|
|
|
222
227
|
property.example = "2021-03-23";
|
|
223
228
|
}
|
|
224
229
|
else {
|
|
225
|
-
const standardTypes = ["string", "number", "boolean", "integer"];
|
|
230
|
+
const standardTypes = ["string", "number", "boolean", "integer", "any"];
|
|
226
231
|
if (typeof type === "string" &&
|
|
227
232
|
!standardTypes.includes(type.toLowerCase())) {
|
|
228
233
|
delete property.type;
|
|
@@ -64,7 +64,7 @@ class ModelParser {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
let splittedLine2 = splittedLine[1].replace(/;/g, "").split(":");
|
|
67
|
-
let field = splittedLine2[0];
|
|
67
|
+
let field = splittedLine2[0].replace('?', '');
|
|
68
68
|
let type = splittedLine2[1] || "";
|
|
69
69
|
type = type.trim();
|
|
70
70
|
let enums = [];
|