inheritance – Using the Swagger/Openapi to override a property shared between two schemas

I have 2 schemas (UserDetails & UserDetails-Create) with the difference between them being the description property of the birth-date field.

Is there a way to inherit all properties from UserDetails but override the description attribute on one of them?

I’m aware that you can modify the required attribute like this which is nifty:

      - name
      - age
      - birth-date
        - $ref: '#/components/schemas/UserDetails'

Wondering if there is a shorthand way similar to the above that solves my problem?

Read more here: Source link