carbond.Operation¶
An Operation represents a single HTTP method on an endpoint (GET, PUT, POST, CREATE, DELETE, HEAD, OPTIONS).
An Operation implements this HTTP method via service. XXX
Each Operation can define any number of OperationParameter. All parameters provided to an Operation will be available via the parameters property of the HttpRequest object and can be accessed as req.parameters[<parameter-name>] or req.parameters.<parameter-name>.
Carbond supports both JSON and EJSON (Extended JSON, which includes support additional types such as Date and ObjectId).
Formally defining parameters for operations helps you to build a self-describing API for which the framework can then auto-generate API documention and interactive administration tools.
Configuration¶
{
_type: carbon.carbond.Operation,
[description: <string>],
[parameters: {
<name>: <OperationParameter>,
...
}],
service: <function>
}
Properties¶
path(read-only) - the path to which this endpoint is bound. The path can contain variable patterns such asorders/:id. Thepathproperty is not configured directly onEndpointobjects but are specified as lvals in enclosing defininitions of endpoints such as in anObjectServeror a parentEndpointobject. When retrieved the value of this property will be the absolute path of the endpoint from/.objectserver(read-only) - theObjectServerof which this endpoint is a partendpoints- an set of childEndpointdefinitions. This is an object whose keys are path string and values are instances ofEndpoint. Each path key will be interpreted as relative to thisEndpointspathproperty. Path keys can define variable bindings (e.g.orders/:id)