表示输入参数是Apiary中的日期/时间的正确格式是什么?

时间:2015-07-09 15:20:00

标签: apiblueprint apiary.io apiary

我正在编辑我正在处理的项目的一些Apiary文档,并且需要表示我的一个API调用的参数是一个日期时间字符串。 Apiary似乎对这个参数的格式化感到窒息,所以我想知道在Apiary中记录这个参数的建议方法是什么。

为了演示,我从Apiary获取了标准的默认文档并修改了Choice文档以获取日期时间对象,如下所示:

## Choice [/questions/{question_id}/choices/{choice_id}/{datetime}]

+ Parameters
    + question_id: 1 (required, number) - ID of the Question in form of an integer
    + choice_id: 1 (required, number) - ID of the Choice in form of an integer
    + datetime: 2015-05-05T12:30:00 (optional, date) - The date/time (ISO8601 format) associated with this choice

最终结果如下:

datetime
05-05T12:30:00 (optional, date) - The date/time (ISO8601 format) that all returned events should be greater than or equal to Example: 2015.

这显然是错误的,甚至记下示例值。破折号(-)是一个特殊的角色,在这里造成悲伤。这样做的推荐方法是什么?

1 个答案:

答案 0 :(得分:20)

你应该be able to use backticks作为逃避序列。另请注意there is no such type as date。您应该使用string

+ datetime: `2015-05-05T12:30:00` (optional, string) - The date/time (ISO8601 format) associated with this choice