mirror of
https://github.com/LukeHagar/SwagDefGen.git
synced 2025-12-09 12:47:44 +00:00
Fixed type 'array' not being identified as base object
This commit is contained in:
@@ -123,12 +123,16 @@ function convert () {
|
|||||||
changeIndentation(1);
|
changeIndentation(1);
|
||||||
//For each object inside the JSON
|
//For each object inside the JSON
|
||||||
for (var obj in inJSON) {
|
for (var obj in inJSON) {
|
||||||
if (typeof inJSON[obj] === "object") {
|
if (typeof inJSON[obj] === "object") {
|
||||||
// ---- Begin object scope ----
|
// ---- Begin object scope ----
|
||||||
outSwagger += indentator + '"' + obj + '": {'
|
outSwagger += indentator + '"' + obj + '": {'
|
||||||
changeIndentation(tabCount+1);
|
changeIndentation(tabCount+1);
|
||||||
convertObject(inJSON[obj], obj);
|
if (Object.prototype.toString.call(inJSON[obj]) === '[object Array]') {
|
||||||
// ---- End object scope ----
|
convertArray(inJSON[obj][0], obj);
|
||||||
|
} else {
|
||||||
|
convertObject(inJSON[obj], obj);
|
||||||
|
}
|
||||||
|
// ---- End object scope ----
|
||||||
changeIndentation(tabCount-1);
|
changeIndentation(tabCount-1);
|
||||||
outSwagger += indentator + '},';
|
outSwagger += indentator + '},';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user