如果在请求中未收到密钥,SWAGGER模式是否可以向对象添加密钥?图解示例:
topobject:
type: object
properties:
attra:
type: ["string", "null"]
default: null
example: "0231"
attrb:
type: string
example: 12abc3123abc123
required:
- attrb
我想知道是否收到像
这样的请求 body: {topobject: {attrb:"asdasdad"}}
,
swagger可以将其转换为:
body: {topobject: {attrb:"asdasdad", attra: null}}
即添加具有默认值的密钥
谢谢!