mirror of https://gitee.com/bigwinds/arangodb
properly display required pathParams in Foxx documentation
do not restrict route summary to 60 characters
This commit is contained in:
parent
a8282f8220
commit
e5adbf4f56
|
@ -133,13 +133,14 @@ constructRoute = function (method, route, callback, controller, constraints) {
|
|||
};
|
||||
};
|
||||
|
||||
constructPathParamDoc = function (paramName, description, dataType) {
|
||||
constructPathParamDoc = function (paramName, description, dataType, required) {
|
||||
'use strict';
|
||||
return {
|
||||
paramType: "path",
|
||||
name: paramName,
|
||||
description: description,
|
||||
dataType: dataType
|
||||
dataType: dataType,
|
||||
required: required
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -138,9 +138,9 @@ extend(SwaggerDocs.prototype, {
|
|||
this.docs.nickname = internal.constructNickname(httpMethod, match);
|
||||
},
|
||||
|
||||
addPathParam: function (paramName, description, dataType) {
|
||||
addPathParam: function (paramName, description, dataType, required) {
|
||||
'use strict';
|
||||
this.docs.parameters.push(internal.constructPathParamDoc(paramName, description, dataType));
|
||||
this.docs.parameters.push(internal.constructPathParamDoc(paramName, description, dataType, required));
|
||||
},
|
||||
|
||||
addQueryParam: function (paramName, description, dataType, required, allowMultiple) {
|
||||
|
@ -279,7 +279,7 @@ extend(RequestContext.prototype, {
|
|||
} else {
|
||||
type = cfg.type;
|
||||
}
|
||||
required = Boolean(cfg.flags && cfg.flags.presense === 'required');
|
||||
required = Boolean(cfg.flags && cfg.flags.presence === 'required');
|
||||
description = cfg.description;
|
||||
if (
|
||||
type === 'number' &&
|
||||
|
@ -302,7 +302,7 @@ extend(RequestContext.prototype, {
|
|||
throw new Error("Illegal attribute type: " + regexType);
|
||||
}
|
||||
this.route.url = internal.constructUrlObject(url.match, urlConstraint, url.methods[0]);
|
||||
this.docs.addPathParam(paramName, description, type);
|
||||
this.docs.addPathParam(paramName, description, type, required);
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -490,8 +490,8 @@ extend(RequestContext.prototype, {
|
|||
|
||||
summary: function (summary) {
|
||||
'use strict';
|
||||
if (summary.length > 60) {
|
||||
throw new Error("Summary can't be longer than 60 characters");
|
||||
if (summary.length > 8192) {
|
||||
throw new Error("Summary can't be longer than 8192 characters");
|
||||
}
|
||||
this.docs.addSummary(summary);
|
||||
return this;
|
||||
|
|
Loading…
Reference in New Issue