Merge branch 'release/1.5.2' into production
This commit is contained in:
commit
95e458c09b
|
@ -0,0 +1,265 @@
|
||||||
|
2014-11-29, Version 1.5.2
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* model-helper: ignore unknown property types (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
|
||||||
|
2014-10-24, Version 1.5.1
|
||||||
|
=========================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2014-10-24, Version 1.5.0
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Add an option `uiDirs` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* swagger: honour X-Forwarded-Proto header (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
|
||||||
|
2014-10-21, Version 1.4.0
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Add integration tests for included models (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* route-helper: add `responseMessages` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* model-helper: support anonymous object types (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* swagger: include models from accepts/returns args (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* loopbackStyles: improve spacing in small window (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* swagger: Deprecate `opts.swaggerVersion` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* swagger: use X-Forwarded-Host for basePath (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* example: use PersistedModel instead of Model (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* models: include model's `description` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Refactor conversion of data types (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Move `convertText` to `typeConverter` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Add support for `context` and `res` param types (Krishna Raman)
|
||||||
|
|
||||||
|
* package: update devDependencies (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* gitignore: add .idea, *.tgz, *.iml (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Support multi-line array `description` and `notes` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Use `1.0.0` as the default app version. (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Extend `consumes` and `produces` metadata (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* route-helper: include `notes` and `deprecated` (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Pull model description from ctor.settings first (Shelby Sanders)
|
||||||
|
|
||||||
|
|
||||||
|
2014-10-08, Version 1.3.0
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* swagger: allow cross-origin requests (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Sort endpoints by letter. (Samuel Reed)
|
||||||
|
|
||||||
|
* Add syntax highlighting styles & highlight threshold. (Samuel Reed)
|
||||||
|
|
||||||
|
* Add contribution guidelines (Ryan Graham)
|
||||||
|
|
||||||
|
|
||||||
|
2014-09-22, Version 1.2.11
|
||||||
|
==========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Fix how the array of models is iterated (Raymond Feng)
|
||||||
|
|
||||||
|
|
||||||
|
2014-09-05, Version 1.2.10
|
||||||
|
==========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Make sure nested/referenced models in array are mapped to swagger (Clark Wang)
|
||||||
|
|
||||||
|
* Make sure nested/referenced models are mapped to swagger (Raymond Feng)
|
||||||
|
|
||||||
|
|
||||||
|
2014-08-15, Version 1.2.9
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Newest Swagger UI requires application/x-www-form-urlencoded. (Samuel Reed)
|
||||||
|
|
||||||
|
* Use `dist` property from swagger-ui package. (Samuel Reed)
|
||||||
|
|
||||||
|
* Fixed undefined modelClass when using polymorphic relations (Navid Nikpour)
|
||||||
|
|
||||||
|
|
||||||
|
2014-08-08, Version 1.2.8
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Fix the type name for a property if model class is used (Raymond Feng)
|
||||||
|
|
||||||
|
|
||||||
|
2014-08-04, Version 1.2.7
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Set up default consumes/produces media types (Raymond Feng)
|
||||||
|
|
||||||
|
* Fix the default opts (Raymond Feng)
|
||||||
|
|
||||||
|
* Add required swagger 1.2 items property for property type array (Ritchie Martori)
|
||||||
|
|
||||||
|
* Allow passing a custom protocol. (Samuel Reed)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-29, Version 1.2.6
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* res.send deprecated - updated to res.status (Geoffroy)
|
||||||
|
|
||||||
|
* Remove hidden properties from definition. (Samuel Reed)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-25, Version 1.2.5
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Ensure models from relations are included (Raymond Feng)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-22, Version 1.2.4
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* model-helper: handle arrays with undefined items (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-22, Version 1.2.3
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* model-helper: handle array types with no item type (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-20, Version 1.2.2
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Properly convert complex return types. (Samuel Reed)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-18, Version 1.2.1
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* Fix up loopback.rest() model definition hack. (Samuel Reed)
|
||||||
|
|
||||||
|
|
||||||
|
2014-07-14, Version 1.2.0
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version and update deps (Raymond Feng)
|
||||||
|
|
||||||
|
* s/accessToken/access_token in authorization key name (Samuel Reed)
|
||||||
|
|
||||||
|
* Fix resources if the explorer is at a deep path. (Samuel Reed)
|
||||||
|
|
||||||
|
* Fix debug namespace, express version. (Samuel Reed)
|
||||||
|
|
||||||
|
* Remove forgotten TODO. (Samuel Reed)
|
||||||
|
|
||||||
|
* Simplify `accepts` and `returns` hacks. (Samuel Reed)
|
||||||
|
|
||||||
|
* More consise type tests (Samuel Reed)
|
||||||
|
|
||||||
|
* Remove preMiddleware. (Samuel Reed)
|
||||||
|
|
||||||
|
* Remove swagger.test.js license (Samuel Reed)
|
||||||
|
|
||||||
|
* Remove peerDependencies, use express directly. (Samuel Reed)
|
||||||
|
|
||||||
|
* Add url-join so path.join() doesn't break windows (Samuel Reed)
|
||||||
|
|
||||||
|
* Rename translateKeys to translateDataTypeKeys. (Samuel Reed)
|
||||||
|
|
||||||
|
* Refactor route-helper & add tests. (Samuel Reed)
|
||||||
|
|
||||||
|
* LDL to Swagger fixes & extensions. (Samuel Reed)
|
||||||
|
|
||||||
|
* Use express routes instead of modifying remoting. (Samuel Reed)
|
||||||
|
|
||||||
|
* Fix missing strong-remoting devDependency. (Samuel Reed)
|
||||||
|
|
||||||
|
* Restore existing styles. (Samuel Reed)
|
||||||
|
|
||||||
|
* Allow easy setting of accessToken in explorer UI. (Samuel Reed)
|
||||||
|
|
||||||
|
* Refactor key translations between LDL & Swagger. (Samuel Reed)
|
||||||
|
|
||||||
|
* Refactoring swagger 1.2 rework. (Samuel Reed)
|
||||||
|
|
||||||
|
* Make sure body parameter is shown. (Raymond Feng)
|
||||||
|
|
||||||
|
* Some swagger 1.2 migration cleanup. (Samuel Reed)
|
||||||
|
|
||||||
|
* Fix api resource path and type ref to models. (Raymond Feng)
|
||||||
|
|
||||||
|
* Swagger 1.2 compatability. Moved strong-remoting/ext/swagger to this module. (Samuel Reed)
|
||||||
|
|
||||||
|
* Load swagger ui from `swagger-ui` package instead. (Samuel Reed)
|
||||||
|
|
||||||
|
|
||||||
|
2014-05-28, Version 1.1.1
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* package.json: add support for loopback 2.x (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Make sure X-Powered-By header is disabled (Alex Pica)
|
||||||
|
|
||||||
|
* Fix license url (Raymond Feng)
|
||||||
|
|
||||||
|
* Update to dual MIT/StrongLoop license (Raymond Feng)
|
||||||
|
|
||||||
|
|
||||||
|
2014-01-14, Version 1.1.0
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump up loopback min version to 1.5 (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Use `app.get('restApiRoot')` as default basePath (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
* Replace strong-remoting ext/swagger with app.docs (Miroslav Bajtoš)
|
||||||
|
|
||||||
|
|
||||||
|
2014-01-13, Version 1.0.2
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* Bump version (Raymond Feng)
|
||||||
|
|
||||||
|
* README: mount REST at /api in the sample code (Miroslav Bajtos)
|
||||||
|
|
||||||
|
* Reorder middleware to fix unit-test failures. (Miroslav Bajtos)
|
||||||
|
|
||||||
|
* Fix loading of loopback dependencies. (Miroslav Bajtos)
|
||||||
|
|
||||||
|
|
||||||
|
2013-12-04, Version 1.0.1
|
||||||
|
=========================
|
||||||
|
|
||||||
|
* First release!
|
|
@ -21,8 +21,15 @@ var modelHelper = module.exports = {
|
||||||
*/
|
*/
|
||||||
generateModelDefinition: function generateModelDefinition(modelClass, definitions) {
|
generateModelDefinition: function generateModelDefinition(modelClass, definitions) {
|
||||||
var def = modelClass.definition;
|
var def = modelClass.definition;
|
||||||
var name = def.name;
|
|
||||||
var out = definitions || {};
|
var out = definitions || {};
|
||||||
|
|
||||||
|
if (!def) {
|
||||||
|
// The model does not have any definition, it was most likely
|
||||||
|
// created as a placeholder for an unknown property type
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
var name = def.name;
|
||||||
if (out[name]) {
|
if (out[name]) {
|
||||||
// The model is already included
|
// The model is already included
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "loopback-explorer",
|
"name": "loopback-explorer",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"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": {
|
||||||
|
|
|
@ -198,6 +198,18 @@ describe('model-helper', function() {
|
||||||
expect(Object.keys(defs)).has.property('length', 1);
|
expect(Object.keys(defs)).has.property('length', 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/strongloop/loopback-explorer/issues/71
|
||||||
|
it('should skip unknown types', function() {
|
||||||
|
var Model8 = loopback.createModel('Model8', {
|
||||||
|
patient: {
|
||||||
|
model: 'physician',
|
||||||
|
type: 'hasMany',
|
||||||
|
through: 'appointment'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var defs = modelHelper.generateModelDefinition(Model8, {});
|
||||||
|
expect(Object.keys(defs)).to.not.contain('hasMany');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('hidden properties', function() {
|
describe('hidden properties', function() {
|
||||||
|
|
Loading…
Reference in New Issue