Merge remote-tracking branch 'upstream/master' into validate_param_enum
* upstream/master: (53 commits)
1.8.0
Add opts.omitProtocolInBaseUrl
Fix tests broken by fa3035c
(#96)
Fix model description getting lost
1.7.2
Allow submitting token input with empty value to remove token.
Fix duplicate stylesheet issue
Fix explorer tests for different line endings on Windows
1.7.1
Remove unused external font "Droid Sans".
1.7.0
Made API doc of class use the http.path of the class if available, or the name of the class as a fallback
v1.6.4
Prevent double slash in the resource URLs
v1.6.3
Allow `uiDirs` to be defined as a String
Fix bad CLA URL in CONTRIBUTING.md
Add X-UA-Compatible tag
v1.6.2
Move 200 response to `type` on the operation object. See #75.
...
This commit is contained in:
commit
1294b53f5c
20
CHANGES.md
20
CHANGES.md
|
@ -1,3 +1,23 @@
|
|||
2015-06-25, Version 1.8.0
|
||||
=========================
|
||||
|
||||
* Add opts.omitProtocolInBaseUrl (Miroslav Bajtoš)
|
||||
|
||||
* Fix tests broken by fa3035c (#96) (Miroslav Bajtoš)
|
||||
|
||||
* Fix model description getting lost (bkniffler)
|
||||
|
||||
|
||||
2015-03-30, Version 1.7.2
|
||||
=========================
|
||||
|
||||
* Allow submitting token input with empty value to remove token. (Samuel Reed)
|
||||
|
||||
* Fix duplicate stylesheet issue (Pradnya Baviskar)
|
||||
|
||||
* Fix explorer tests for different line endings on Windows (Pradnya Baviskar)
|
||||
|
||||
|
||||
2015-02-23, Version 1.7.1
|
||||
=========================
|
||||
|
||||
|
|
|
@ -144,7 +144,8 @@ var modelHelper = module.exports = {
|
|||
out[name] = {
|
||||
id: name,
|
||||
additionalProperties: additionalProperties,
|
||||
description: typeConverter.convertText(def.description),
|
||||
description: typeConverter.convertText(
|
||||
def.description || (def.settings && def.settings.description)),
|
||||
properties: properties,
|
||||
required: required
|
||||
};
|
||||
|
|
|
@ -192,8 +192,9 @@ function addRoute(app, uri, doc, opts) {
|
|||
var headers = req.headers;
|
||||
// NOTE header names (keys) are always all-lowercase
|
||||
var proto = headers['x-forwarded-proto'] || opts.protocol || req.protocol;
|
||||
var prefix = opts.omitProtocolInBaseUrl ? '//' : proto + '://';
|
||||
var host = headers['x-forwarded-host'] || headers.host;
|
||||
doc.basePath = proto + '://' + host + initialPath;
|
||||
doc.basePath = prefix + host + initialPath;
|
||||
}
|
||||
res.status(200).send(doc);
|
||||
});
|
||||
|
|
10
package.json
10
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-explorer",
|
||||
"version": "1.7.1",
|
||||
"version": "1.8.0",
|
||||
"description": "Browse and test your LoopBack app's APIs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -22,9 +22,9 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"loopback": "git+https://github.com/shelbys/loopback.git#validate_param_enum",
|
||||
"mocha": "^2.2.5",
|
||||
"supertest": "~1.0.1",
|
||||
"chai": "^2.3.0"
|
||||
"mocha": "^1.21.5",
|
||||
"supertest": "~0.14.0",
|
||||
"chai": "^1.9.1"
|
||||
},
|
||||
"license": {
|
||||
"name": "Dual MIT/StrongLoop",
|
||||
|
@ -35,6 +35,6 @@
|
|||
"debug": "~1.0.3",
|
||||
"express": "3.x",
|
||||
"lodash": "^2.4.1",
|
||||
"swagger-ui": "git+https://github.com/shelbys/swagger-ui.git"
|
||||
"swagger-ui": "git+https://github.com/shelbys/swagger-ui.git"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
color: #080;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
.contentWell {
|
||||
padding-left: 30px;
|
||||
padding-right: 30px;
|
||||
|
@ -43,13 +42,11 @@
|
|||
/*
|
||||
FIXME: Separate the overrides from the rest of the styles, rather than override screen.css entirely.
|
||||
*/
|
||||
=======
|
||||
/* Improve spacing when the browser window is small */
|
||||
#message-bar, #swagger-ui-container {
|
||||
padding-left: 30px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
>>>>>>> upstream/master
|
||||
|
||||
#api_selector {
|
||||
padding: 0px 20px;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>StrongLoop API Explorer</title>
|
||||
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
|
||||
<link href='css/reset.css' media='screen,print' rel='stylesheet' type='text/css'/>
|
||||
<link href='css/screen.css' media='screen,print' rel='stylesheet' type='text/css'/>
|
||||
<link href='css/loopbackStyles.css' rel='stylesheet' type='text/css'/>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
var classHelper = require('../lib/class-helper');
|
||||
var expect = require('chai').expect;
|
||||
var _defaults = require('lodash').defaults;
|
||||
var loopback = require('loopback');
|
||||
|
||||
describe('class-helper', function() {
|
||||
it('joins array descriptions', function() {
|
||||
|
|
|
@ -105,6 +105,20 @@ describe('swagger definition', function() {
|
|||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('supports options.omitProtocolInBaseUrl', function(done) {
|
||||
var app = givenAppWithSwagger({ omitProtocolInBaseUrl: true });
|
||||
|
||||
var getReq = getAPIDeclaration(app, 'products');
|
||||
getReq.end(function(err, res) {
|
||||
if (err) return done(err);
|
||||
var basePath = res.body.basePath;
|
||||
expect(basePath).to.match(/^\/\//);
|
||||
var parsed = url.parse(res.body.basePath);
|
||||
expect(parsed.protocol).to.equal(null);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Model definition attributes', function() {
|
||||
|
@ -394,7 +408,7 @@ describe('swagger definition', function() {
|
|||
|
||||
function givenPrivateAppModel(app, name, properties) {
|
||||
var model = loopback.createModel(name, properties);
|
||||
app.model(model, { dataSource: 'db', documented: false} );
|
||||
app.model(model, { dataSource: 'db', public: false} );
|
||||
}
|
||||
|
||||
function givenWarehouseWithAddressModels(app) {
|
||||
|
|
Loading…
Reference in New Issue