I want some parameters to be optional in the JSON body. I have made phpdocs and set the parameter to null:
/**
* Create a new text
*
* @param int $product_id product id
* @param int $template_id {@from body} template id
* @param string $language {@from body} the language of the text
* @param string $name {@from body} product name
*
* @url POST {product_id}/texts
*/
public function postText($product_id, $template_id, $market_id = null)
{ }
But Restler gives me:
{
"error": {
"code": 400,
"message": "Bad Request: market_id is missing."
}
}
How do I specify a parameter to be optional?