如何解决如何为多类型数组定义json schma
Json示例:
{
"testResults": [
"begin",[
"call step 1.1","call step 1.2"
],[
"call step 2.1",[
"call step 2.1.1",[
"call step 2.1.1.1","call step 2.1.1.2"
],[
"call step 2.1.2.1","call step 2.1.2.2"
],"end call step 2.1.1"
]
],"end"
]
}
Json模式
TestResults:
type: array
items:
anyOf:
- type: string
- $ref: "#/components/schemas/TestResults"
我不确定给定的架构是否正确。俗话说,TestResults由任何字符串及其本身组成。
解决方法
您可以按照以下示例来了解这一点
3.4666666666666666666666666667
2
3.1891847822775947292439110472
20
3.1465677471829564012877876609
200
3.1420924036835276076022995132
2000
3.1416426510898869869000847891
20000
3.1415976535647933322124871234
200000
3.1415931535895432385563933310
2000000
3.1415927035897907384627370503
20000000
3.1415926585897932134626435385
200000000
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。