简体   繁体   English

时间数据类型元素的数组

[英]Array of time datatype elements

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]`"

Updated: 更新:

We have just added two types time ( time24 ) and time12 for this purpose 为此,我们刚刚添加了两种类型的timetime24 )和time12

Download the latest Restler3 RC4 to get this functionality 下载最新的Restler3 RC4以获取此功能

/**
 * 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 资源管理器上尝试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM