Changed Swagger() to omit resources with no content

This commit is contained in:
Shelby Sanders 2015-02-07 22:59:00 -08:00
parent 3ca1f45a77
commit 24146313ec
2 changed files with 12 additions and 2 deletions

View File

@ -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);

View File

@ -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": {