Swagger 如何在OpenAPIyml中的映射对象中定义多个对象时间
我是openapi的新手。我需要一些帮助来编写OpenAPIyml3.0 对于以下响应格式Swagger 如何在OpenAPIyml中的映射对象中定义多个对象时间,swagger,swagger-ui,openapi,swagger-2.0,swagger-editor,Swagger,Swagger Ui,Openapi,Swagger 2.0,Swagger Editor,我是openapi的新手。我需要一些帮助来编写OpenAPIyml3.0 对于以下响应格式 { “Details”: { “detail1”: [ { "id": “idvalue”1, “Info”: { “Testinfo1”: "1.0.0", “Testinf
{
“Details”: {
“detail1”: [
{
"id": “idvalue”1,
“Info”: {
“Testinfo1”: "1.0.0",
“Testinfo2”: "2.0.0"
}
}
],
“Detail2”: [
{
"id": “idvalue2”,
“Info”: {
“Testinfo3”: "1.0.0",
“Testinfo4”: "2.0.0" }
}
],
"Detail3”: [
{
“First name”: “firstName,
“Lastname: “last”Name,
“Address”: “address”,
“Dependents”: []
}
]
},
"links": {
"self": {
"href": “some url”
}
}
}
detail1、detail2、detail3可以是不同的对象类型,也可以是相同的对象类型
而且可能没有任何细节。
我被以下几点打动了
检查下面的YAML snap
DetailsSchemaElement:
type: object
properties:
Details:
type: object
properties:
detail1:
type: array
items:
properties:
id:
type: string
Info:
type: object
properties:
Testinfo1:
type: string
Testinfo2:
type: string
Detail2:
type: array
items:
properties:
id:
type: string
Info:
type: object
properties:
Testinfo4:
type: string
Testinfo3:
type: string
Detail3:
type: array
items:
properties:
First-name:
type: string
Address:
type: string
Dependents:
type: array
items:
type: string
Lastname:
type: string
links:
type: object
properties:
self:
type: object
properties:
href:
type: string
检查下面的YAML snap
DetailsSchemaElement:
type: object
properties:
Details:
type: object
properties:
detail1:
type: array
items:
properties:
id:
type: string
Info:
type: object
properties:
Testinfo1:
type: string
Testinfo2:
type: string
Detail2:
type: array
items:
properties:
id:
type: string
Info:
type: object
properties:
Testinfo4:
type: string
Testinfo3:
type: string
Detail3:
type: array
items:
properties:
First-name:
type: string
Address:
type: string
Dependents:
type: array
items:
type: string
Lastname:
type: string
links:
type: object
properties:
self:
type: object
properties:
href:
type: string