I am using openapi 3.0.3 version and we have scanario where we don't want to make one field mandatory for Response. Below is the example of Open Api Schema Snippit.
For example here is the MerchantDetails object where we have 'merchantName' and 'merchantId' as required field.
MerchantDetails:
description: Used to pass merchant specific data during the transaction.
properties:
merchantName:
type: string
maxLength: 64
merchantId:
type: string
maxLength: 16
required:
- merchantName
- merchantId
In Response we are using same object but we want to keep only one field 'merchantId' as required. Is there any way do achieve this without creating new object?
MerchantDetails:
description: Used to pass merchant specific data during the transaction.
properties:
merchantName:
type: string
maxLength: 64
merchantId:
type: string
maxLength: 16
required:
- merchantId