From 739219d3060bdd83483c2cc7e6a5554edd829cd8 Mon Sep 17 00:00:00 2001 From: bpinkney Date: Tue, 24 Jan 2012 14:12:05 -0500 Subject: [PATCH] Fixed conflicts --- build/javascripts/swagger-service.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 {