如何以 swagger yaml 格式声明嵌入的正文参数
How to declare embedded body parameters in swagger yaml format
我在 JSON 中有一个带有嵌套 post 参数的示例请求输入,如下所示。我必须知道使用这些数据来创建 YAML 格式的定义,但我不知道该怎么做。
我已经阅读了 swagger 文档,但仍然无法破解。
"clientAttributes" : [ {
"id" : "1",
"clientDetail" : [ {
"clientNum" : "98062217",
"clientCntryCd" : "55",
"clientTypeList" : [ {
"clientTypeCd" : "HomePhone",
"cntryCd" : ""
} ]
} ]} ],
一个很好的例子是 petstore.yaml 中定义的 Pet
对象,它包含 2 个对象作为属性:category
、tags
对于您的情况,您需要将 clientAttributes
、clientDetail
、clientTypeList
定义为对象。
我在 JSON 中有一个带有嵌套 post 参数的示例请求输入,如下所示。我必须知道使用这些数据来创建 YAML 格式的定义,但我不知道该怎么做。
我已经阅读了 swagger 文档,但仍然无法破解。
"clientAttributes" : [ {
"id" : "1",
"clientDetail" : [ {
"clientNum" : "98062217",
"clientCntryCd" : "55",
"clientTypeList" : [ {
"clientTypeCd" : "HomePhone",
"cntryCd" : ""
} ]
} ]} ],
一个很好的例子是 petstore.yaml 中定义的 Pet
对象,它包含 2 个对象作为属性:category
、tags
对于您的情况,您需要将 clientAttributes
、clientDetail
、clientTypeList
定义为对象。