connexion==2.3.0 swagger-ui-bundle==0.0.5 OAS 3.0
开放式 APi 规范中的“anyOf”不会向 requestBody 中的字段/元素呈现任何有用的输入。生成的 curl 请求使用了错误的 key:values
"components": {
"requestBodies": {
"customEventBody": {[enter image description here][1]
"content": {
"application/x-www-form-urlencoded":{
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/Interrupt"
},
{
"$ref": "#/components/schemas/injected_val"
},
{
"$ref": "#/components/schemas/document"
}
]
}
}
},
}
},
"schemas": {
"Interrupt": {
"title": "Interrupt event",
"type": "object",
"properties": {
"Interrupt": {
"type": "boolean"
}
}
},
"injected_val": {
"title": "Injected value",
"type": "object",
"properties": {
"injected_val": {
"type": "string"
}
}
},
"document": {
"title": "document",
"type": "object",
"properties": {
"document": {
"type": "string"
}
}
}
}
}
}
当我想从 swagger UI 中尝试 curl 命令时生成的 Curl 请求:
curl -X POST " http://xx.yy.zz.ee:8080/api/v1/calls/54544/js " -H "accept: / " -H "Content-Type: application/x-www-form -urlencoded" -d "0='&1=I&2=n&3=t&4=e&5=r&6=r&7=u&8=p&9=t&10='&11=%3D&12='&13=t&14=r&15=u&16=e&17='"
Swagger UI 示例截图: