大摇大摆,如何将对象属性放在界面的单独字段中?

时间:2019-10-11 06:17:29

标签: swagger openapi

是否可以在界面的Swagger中将对象的属性放在单独的字段中,如下面的屏幕快照所示? Swagger 2.0或3.0版本。

Example

重要:这些单独的对象字段必须在请求正文中。

我现在所做的:

1)代码:

      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                example_obj:
                  type: object
                  properties:
                    field1:
                      type: string
                    from:
                      type: object
                      properties:
                        field2:
                          type: string
                    field3:
                      type: string

2)我的结果:

my result

0 个答案:

没有答案