拆下
value
钥匙从
example
价值
examples
"example": "<project><foo>1</foo><bar>2</bar></project>"
或者,可以定义
schema
对于响应,Swagger UI将根据
架构
. 在您的示例中,模式是
project
foo
[1, 2]
福
数组:
"components": {
"responses": {
"trait_hasProjectResponse_200": {
"description": "",
"content": {
"application/xml": {
"schema": {
"$ref": "#/components/schemas/project"
}
}
}
}
},
"schemas": {
"project": {
"type": "object",
"properties": {
"foo": {
"type": "array",
"items": {
"type": "integer"
},
"xml": {
"wrapped": false
},
"example": [1, 2]
}
}
}
}
}
这将为您提供: