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:
Shelby Sanders 2015-07-02 11:19:18 -07:00
commit 1294b53f5c
8 changed files with 44 additions and 13 deletions

View File

@ -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 2015-02-23, Version 1.7.1
========================= =========================

View File

@ -144,7 +144,8 @@ var modelHelper = module.exports = {
out[name] = { out[name] = {
id: name, id: name,
additionalProperties: additionalProperties, additionalProperties: additionalProperties,
description: typeConverter.convertText(def.description), description: typeConverter.convertText(
def.description || (def.settings && def.settings.description)),
properties: properties, properties: properties,
required: required required: required
}; };

View File

@ -192,8 +192,9 @@ function addRoute(app, uri, doc, opts) {
var headers = req.headers; var headers = req.headers;
// NOTE header names (keys) are always all-lowercase // NOTE header names (keys) are always all-lowercase
var proto = headers['x-forwarded-proto'] || opts.protocol || req.protocol; var proto = headers['x-forwarded-proto'] || opts.protocol || req.protocol;
var prefix = opts.omitProtocolInBaseUrl ? '//' : proto + '://';
var host = headers['x-forwarded-host'] || headers.host; var host = headers['x-forwarded-host'] || headers.host;
doc.basePath = proto + '://' + host + initialPath; doc.basePath = prefix + host + initialPath;
} }
res.status(200).send(doc); res.status(200).send(doc);
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "loopback-explorer", "name": "loopback-explorer",
"version": "1.7.1", "version": "1.8.0",
"description": "Browse and test your LoopBack app's APIs", "description": "Browse and test your LoopBack app's APIs",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -22,9 +22,9 @@
}, },
"devDependencies": { "devDependencies": {
"loopback": "git+https://github.com/shelbys/loopback.git#validate_param_enum", "loopback": "git+https://github.com/shelbys/loopback.git#validate_param_enum",
"mocha": "^2.2.5", "mocha": "^1.21.5",
"supertest": "~1.0.1", "supertest": "~0.14.0",
"chai": "^2.3.0" "chai": "^1.9.1"
}, },
"license": { "license": {
"name": "Dual MIT/StrongLoop", "name": "Dual MIT/StrongLoop",
@ -35,6 +35,6 @@
"debug": "~1.0.3", "debug": "~1.0.3",
"express": "3.x", "express": "3.x",
"lodash": "^2.4.1", "lodash": "^2.4.1",
"swagger-ui": "git+https://github.com/shelbys/swagger-ui.git" "swagger-ui": "git+https://github.com/shelbys/swagger-ui.git"
} }
} }

View File

@ -34,7 +34,6 @@
color: #080; color: #080;
} }
<<<<<<< HEAD
.contentWell { .contentWell {
padding-left: 30px; padding-left: 30px;
padding-right: 30px; padding-right: 30px;
@ -43,13 +42,11 @@
/* /*
FIXME: Separate the overrides from the rest of the styles, rather than override screen.css entirely. FIXME: Separate the overrides from the rest of the styles, rather than override screen.css entirely.
*/ */
=======
/* Improve spacing when the browser window is small */ /* Improve spacing when the browser window is small */
#message-bar, #swagger-ui-container { #message-bar, #swagger-ui-container {
padding-left: 30px; padding-left: 30px;
padding-right: 30px; padding-right: 30px;
} }
>>>>>>> upstream/master
#api_selector { #api_selector {
padding: 0px 20px; padding: 0px 20px;

View File

@ -3,7 +3,6 @@
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>StrongLoop API Explorer</title> <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/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/screen.css' media='screen,print' rel='stylesheet' type='text/css'/>
<link href='css/loopbackStyles.css' rel='stylesheet' type='text/css'/> <link href='css/loopbackStyles.css' rel='stylesheet' type='text/css'/>

View File

@ -3,7 +3,6 @@
var classHelper = require('../lib/class-helper'); var classHelper = require('../lib/class-helper');
var expect = require('chai').expect; var expect = require('chai').expect;
var _defaults = require('lodash').defaults; var _defaults = require('lodash').defaults;
var loopback = require('loopback');
describe('class-helper', function() { describe('class-helper', function() {
it('joins array descriptions', function() { it('joins array descriptions', function() {

View File

@ -105,6 +105,20 @@ describe('swagger definition', function() {
done(); 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() { describe('Model definition attributes', function() {
@ -394,7 +408,7 @@ describe('swagger definition', function() {
function givenPrivateAppModel(app, name, properties) { function givenPrivateAppModel(app, name, properties) {
var model = loopback.createModel(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) { function givenWarehouseWithAddressModels(app) {