Changed Swagger() to omit resources with no content
This commit is contained in:
parent
3ca1f45a77
commit
24146313ec
|
@ -45,7 +45,17 @@ function Swagger(loopbackApplication, swaggerApp, opts) {
|
|||
// A class is an endpoint root; e.g. /users, /products, and so on.
|
||||
classes.forEach(function (aClass) {
|
||||
var doc = apiDocs[aClass.name] = classHelper.generateAPIDoc(aClass, opts);
|
||||
resourceDoc.apis.push(classHelper.generateResourceDocAPIEntry(aClass));
|
||||
var hasPublic = false;
|
||||
var methods = aClass.methods()
|
||||
for (var methodKey in methods) {
|
||||
hasPublic = methods[methodKey].public;
|
||||
if (hasPublic) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasPublic) {
|
||||
resourceDoc.apis.push(classHelper.generateResourceDocAPIEntry(aClass));
|
||||
}
|
||||
|
||||
// Add the getter for this doc.
|
||||
var docPath = urlJoin(opts.resourcePath, aClass.http.path);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-explorer",
|
||||
"version": "1.2.11",
|
||||
"version": "1.2.12",
|
||||
"description": "Browse and test your LoopBack app's APIs",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue