diff --git a/Documentation/Books/Users/Foxx/FoxxRepository.mdpp b/Documentation/Books/Users/Foxx/FoxxRepository.mdpp index 818b05d93e..a0b2b3d893 100644 --- a/Documentation/Books/Users/Foxx/FoxxRepository.mdpp +++ b/Documentation/Books/Users/Foxx/FoxxRepository.mdpp @@ -146,6 +146,7 @@ attributes are required though): * *license*: Short form of the license (MIT, GPL...) * *name*: Name of the application (Meta information) * *repository*: An object with information about where you can find the repository: *type* and *url* +* *rootElement*: Do you want to have a root element in the requests bodies? Default is false. * *setup*: Path to a setup script * *teardown*: Path to a teardown script * *thumbnail*: Path to a thumbnail that represents the application (Meta information) @@ -528,4 +529,4 @@ When the TemplateMiddleware is included, you will have access to the render func ### Render @copydetails JSF_foxx_TemplateMiddleware_response_render ---> \ No newline at end of file +--> diff --git a/js/server/modules/org/arangodb/foxx/request_context.js b/js/server/modules/org/arangodb/foxx/request_context.js index 6fe2d4b29b..9e0bac5c50 100644 --- a/js/server/modules/org/arangodb/foxx/request_context.js +++ b/js/server/modules/org/arangodb/foxx/request_context.js @@ -284,6 +284,16 @@ extend(RequestContext.prototype, { /// For information about how to annotate your models, see the Model section. /// If you provide the Model in an array, the response will take multiple models /// instead of one. +/// +/// If you wrap the provided model in an array, the body param is always an array +/// and accordingly the return value of the `params` for the body call will also +/// return an array of models. +/// +/// The behavior of `bodyParam` changes depending on the `rootElement` option +/// set in the manifest. If it is set to true, it is expected that the body is an +/// object with a key of the same name as the `paramName` argument. +/// The value of this object is either a single object or in the case of a multi +/// element an array of objects. //////////////////////////////////////////////////////////////////////////////// bodyParam: function (paramName, description, Proto) {