mirror of https://gitee.com/bigwinds/arangodb
Merge pull request #874 from triAGENS/foxx-doc-generator-improvements
Foxx API Documentation explorer doesn't show POST/PUT/PATCH bodies without bodyParam
This commit is contained in:
commit
049067dbc4
|
@ -174,6 +174,11 @@ extend(Controller.prototype, {
|
||||||
|
|
||||||
this.applicationContext.clearComments();
|
this.applicationContext.clearComments();
|
||||||
|
|
||||||
|
if (method === 'post' || method === 'put' || method === 'patch') {
|
||||||
|
var UndocumentedBody = require('org/arangodb/foxx').Model.extend();
|
||||||
|
requestContext.bodyParam("undocumented body", "Undocumented body param", UndocumentedBody);
|
||||||
|
}
|
||||||
|
|
||||||
return requestContext;
|
return requestContext;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -144,12 +144,22 @@ extend(SwaggerDocs.prototype, {
|
||||||
'use strict';
|
'use strict';
|
||||||
this.models[jsonSchema.id] = jsonSchema;
|
this.models[jsonSchema.id] = jsonSchema;
|
||||||
|
|
||||||
|
var param = _.find(this.docs.parameters, function (parameter) {
|
||||||
|
return parameter.name === 'undocumented body';
|
||||||
|
});
|
||||||
|
|
||||||
|
if (_.isUndefined(param)) {
|
||||||
this.docs.parameters.push({
|
this.docs.parameters.push({
|
||||||
name: paramName,
|
name: paramName,
|
||||||
paramType: "body",
|
paramType: "body",
|
||||||
description: description,
|
description: description,
|
||||||
dataType: jsonSchema.id
|
dataType: jsonSchema.id
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
param.name = paramName;
|
||||||
|
param.description = description;
|
||||||
|
param.dataType = jsonSchema.id;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addSummary: function (summary) {
|
addSummary: function (summary) {
|
||||||
|
|
Loading…
Reference in New Issue