The OpenAPI Specification allows combining and extending model definitions using the allOf property of JSON Schema, in effect offering model composition. allOf takes an array of object definitions that are validated independently but together compose a single object.
e.g.
author: {
description: "Details of the user who attached the file.",
readOnly: true,
allOf: [
{
$ref: "#/components/schemas/User"
}
]
}
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#composition-and-inheritance-polymorphism
e.g.