这是我想出的模型:
BaseResponse:
type: object
required:
- success
properties:
success:
type: boolean
default: "false"
discriminator: success
ErrorResponse:
allOf:
- $ref: "#/components/schemas/BaseResponse"
- type: object
properties:
errorCode:
type: string
SuccessResponse:
allOf:
- $ref: "#/components/schemas/BaseResponse"
- type: object
properties:
message:
type: string
我希望能够为SuccessResponse的成功字段指定true,为ErrorResponse的成功字段指定false。我可以在.yaml文件中进行任何处理吗? 我正在使用swagger-codegen v3.0.19(带有maven插件)。 并使用openapi编写yaml文件:“ 3.0.0”