Forum Discussion

kashira's avatar
kashira
New Contributor
3 years ago
Solved

I want to create a component one with default value other one without default value how to do

G'day All,    Please can someone suggest me what is best way to write this component with reuse.    Title:   Type: string     Enum:         - Mr        - Mrs        - Unknown   TitleWithDe...
  • HKosova's avatar
    HKosova
    3 years ago

    "default" needs to be on the same level as "allOf", not inside it.

    TitleWithDefault
      allOf:
        - $ref: '#/components/schemas/Title'
      default: Unknown