/calculate
Folds the operation left-to-right across data. A single-element data array returns that element unchanged.
post
https://api.rest.rodeo/calculator/api/v1/calculate
Body
application/json
Body
application/json
CalculateRequest
* Additional properties are NOT allowed.
operationstringrequired
The arithmetic operation to apply.
Allowed values:additionsubtractmultiply
dataarray[number]required
Operands, folded left-to-right.
>= 1 items
Response
application/json
Response
application/json
The computed result
CalculateResponse
* Additional properties are NOT allowed.
resultnumberrequired
post/calculate
Body
{
"operation": "multiply",
"data": [
2,
1
]
}
application/json
CalculateRequest
object * Additional properties are NOT allowed.
operationstringrequired
The arithmetic operation to apply.
Allowed values:additionsubtractmultiply
dataarray[number]required
Operands, folded left-to-right.
>= 1 items
Example
CalculateResponse
object * Additional properties are NOT allowed.
resultnumberrequired
Example
Error
object * Additional properties are NOT allowed.
errorstringrequired
Example