Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ module.exports = {
// list of files / patterns to load in the browser
files: [
"test/browser/*.js",
"test/both/*.js"
"test/both/*.js",
{pattern: "test/spec/v2/*.json", watched: false, included: false, served: true, nocache: false}
],


Expand Down
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ SwaggerClient.prototype.parseUri = function (uri) {
var parts = urlParseRE.exec(uri);

return {
scheme: parts[4].replace(':',''),
scheme: parts[4] ? parts[4].replace(':','') : undefined,
host: parts[11],
port: parts[12],
path: parts[15]
Expand Down
13 changes: 13 additions & 0 deletions test/browser/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,17 @@ describe('yaml http', function () {
});
});
});

it('should support relative spec URLs as per #645', function(done) {
try {
new Swagger({
url: '/base/test/spec/v2/test.json',
usePromise: true
}).then(function(client) {
done();
});
} catch (exception) {
done(exception);
}
});
});