openapi-sampler icon indicating copy to clipboard operation
openapi-sampler copied to clipboard

pass through required values from allOf level

Open lrobledo opened this issue 5 years ago • 0 comments

I have a use case in which I'm using the allOf discriminator to specify a required parameter that is not generally required for the schema. I was told this is a valid way to express this, though I cannot remember the source.

"schema": {
    "allOf": [
        {
            "$ref": "#/components/schemas/basicSchema"
        }
    ],
    "required": [
        "amount"
    ]
}

lrobledo avatar Oct 16 '20 21:10 lrobledo