From 0d613429194430c9cfcb57c3c4af7b2803ef6903 Mon Sep 17 00:00:00 2001 From: Adrian Ehrsam Date: Fri, 12 Apr 2019 14:12:58 +0200 Subject: [PATCH 1/2] Fix for nan --- ng-swagger-gen.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ng-swagger-gen.js b/ng-swagger-gen.js index 2c06592..54336d3 100644 --- a/ng-swagger-gen.js +++ b/ng-swagger-gen.js @@ -1229,16 +1229,18 @@ function processServices(swagger, models, options) { var op = service.serviceOperations[i]; for (var code in op.operationResponses) { var status = Number(code); - var actualDeps = (status < 200 || status >= 300) - ? errorDependencies : dependencies; - var response = op.operationResponses[code]; - if (response.type) { - var type = response.type; - if (type && type.allTypes) { - // This is an inline object. Append all types - type.allTypes.forEach(t => actualDeps.add(t)); - } else { - actualDeps.add(type); + if (!isNaN(status)) { + var actualDeps = (status < 200 || status >= 300) + ? errorDependencies : dependencies; + var response = op.operationResponses[code]; + if (response.type) { + var type = response.type; + if (type && type.allTypes) { + // This is an inline object. Append all types + type.allTypes.forEach(t => actualDeps.add(t)); + } else { + actualDeps.add(type); + } } } } From 2206f6b912ceb0a58fa4c77866051514f53080f5 Mon Sep 17 00:00:00 2001 From: Adrian Ehrsam Date: Tue, 28 May 2019 11:41:10 +0200 Subject: [PATCH 2/2] Fix a bug in ng-swagger-gen --- ng-swagger-gen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ng-swagger-gen.js b/ng-swagger-gen.js index 54336d3..07f0917 100644 --- a/ng-swagger-gen.js +++ b/ng-swagger-gen.js @@ -1233,7 +1233,7 @@ function processServices(swagger, models, options) { var actualDeps = (status < 200 || status >= 300) ? errorDependencies : dependencies; var response = op.operationResponses[code]; - if (response.type) { + if (response && response.type) { var type = response.type; if (type && type.allTypes) { // This is an inline object. Append all types