diff --git a/build/javascripts/swagger-service.js b/build/javascripts/swagger-service.js index a178cf77..96288111 100644 --- a/build/javascripts/swagger-service.js +++ b/build/javascripts/swagger-service.js @@ -65,7 +65,11 @@ function SwaggerService(baseUrl, _apiKey, statusCallback) { this.path_xml = this.path.replace("{format}", "xml"); this.baseUrl = apiHost; //execluded 9 letters to remove .{format} from name - this.name = this.path.substr(1, this.path.length - formatString.length - 1).replace(/\//g, "_"); + if (this.path.indexOf(formatString) != -1){ + this.name = this.path.substr(1, this.path.length - formatString.length - 1).replace(/\//g, "_"); + } else { + this.name = this.path.substr(1, this.path.length - 1).replace(/\//g, "_"); + } this.apiList = Api.sub(); this.modelList = ApiModel.sub(); }, @@ -99,6 +103,10 @@ function SwaggerService(baseUrl, _apiKey, statusCallback) { this.path_json = prefix.replace("{format}", "json") + suffix; this.path_xml = prefix.replace("{format}", "xml") + suffix;; + if (this.path.indexOf(formatString) == -1){ + formatString = ""; + } + if (this.path.indexOf("/") == 0) { this.name = this.path.substr(1, secondPathSeperatorIndex - formatString.length - 1); } else {