Merge branch 'release/1.6.0' into production
This commit is contained in:
commit
096699d57f
10
CHANGES.md
10
CHANGES.md
|
@ -1,15 +1,21 @@
|
|||
2014-12-02, Version 1.6.0
|
||||
=========================
|
||||
|
||||
* Remove model name from nickname, swagger spec understands op context. (Samuel Reed)
|
||||
|
||||
|
||||
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
|
||||
=========================
|
||||
|
||||
|
||||
|
||||
2014-10-24, Version 1.5.0
|
||||
2014-10-24, Version 1.5.1
|
||||
=========================
|
||||
|
||||
* Add an option `uiDirs` (Miroslav Bajtoš)
|
||||
|
|
|
@ -149,8 +149,10 @@ var routeHelper = module.exports = {
|
|||
// is specified in the first response message.
|
||||
operations: [{
|
||||
method: routeHelper.convertVerb(route.verb),
|
||||
// [rfeng] Swagger UI doesn't escape '.' for jQuery selector
|
||||
nickname: route.method.replace(/\./g, '_'),
|
||||
// [strml] remove leading model name from op, swagger uses leading
|
||||
// path as class name so it remains unique between models.
|
||||
// route.method is always #{className}.#{methodName}
|
||||
nickname: route.method.replace(/.*?\./, ''),
|
||||
parameters: accepts,
|
||||
responseMessages: responseMessages,
|
||||
summary: typeConverter.convertText(route.description),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-explorer",
|
||||
"version": "1.5.2",
|
||||
"version": "1.6.0",
|
||||
"description": "Browse and test your LoopBack app's APIs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -185,11 +185,24 @@ describe('route-helper', function() {
|
|||
responseModel: 'ValidationError'
|
||||
});
|
||||
});
|
||||
|
||||
it('route nickname does not include model name.', function() {
|
||||
var doc = createAPIDoc();
|
||||
expect(doc.operations[0].nickname).to.equal('get');
|
||||
});
|
||||
|
||||
it('route nickname with a period is shorted correctly', function() {
|
||||
// Method is built by remoting to always be #{className}.#{methodName}
|
||||
var doc = createAPIDoc({
|
||||
method: 'test.get.me'
|
||||
});
|
||||
expect(doc.operations[0].nickname).to.eql('get.me');
|
||||
});
|
||||
});
|
||||
|
||||
// Easy wrapper around createRoute
|
||||
function createAPIDoc(def) {
|
||||
return routeHelper.routeToAPIDoc(_defaults(def, {
|
||||
return routeHelper.routeToAPIDoc(_defaults(def || {}, {
|
||||
path: '/test',
|
||||
verb: 'GET',
|
||||
method: 'test.get'
|
||||
|
|
Loading…
Reference in New Issue