如何为jsonschem生成时间字符串

2024-06-02 07:59:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我有这样一个模式:

"foo": {"type": "string", "format": "time"}

我尝试了new (new Date()).toISOString()它有以下格式:

^{pr2}$

错误:

jsonschema.exceptions.ValidationError: '2018-06-12T08:59:01.135Z' is not a 'time'

Tags: formatnewdatestringfootime格式type