Pregunta

What is the correct way to define the validation for array of time datatype elements?

Should be:

@param array $arrayTime The time elements array {@type time}

But then there is no way to pass the validators. No matter the input values, the best I can get is:

"Bad Request: invalid value specified for `arrayTime[0]`"
¿Fue útil?

Solución

Updated:

We have just added two types time(time24) and time12 for this purpose

Download the latest Restler3 RC4 to get this functionality

/**
 * Array of times
 *
 * @param array $times {@from body}{@type time}
 */
function postTimes(array $times)
{
    return $times;
}

We have just added this to our Type test as well

Try it on the explorer

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top