google-discovery-document
Version:
Create and validate a Google API discovery document for use with your own REST service
25 lines (19 loc) • 506 B
JavaScript
;
var _ = require('lodash');
_.mixin(require('congruence'));
var Method = function () { };
Method.template = {
id: _.isString,
path: _.isString,
httpMethod: _.isString,
description: function (description) {
return _.isString(description) || _.isUndefined(description);
},
scopes: function (scopes) {
return _.isArray(scopes) || _.isUndefined(scopes);
}
};
Method.validate = function (method) {
return _.similar(Method.template, method);
};
module.exports = Method;