Swagger允许我们根据需要创建任何字段。
type: object
required:
- name
- email
- sendMail
properties:
name:
type: string
email:
type: string
format: email
sendMail:
type: boolean
default: false
address:
type: string # make this as requred only if sendMail is true
当 sendMail 字段设置为 true 时,是否可以根据需要指示 address 字段?< / p>