Open austinvalle opened 11 months ago
Other use-cases of allOf
from the kubernetes API where there is only one entry (possibly for overriding description?):
"fieldsV1": {
"allOf": [
{
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"
}
],
"description": "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type."
},
I started some work here: https://github.com/raphaelfff/terraform-plugin-codegen-openapi/pull/1
References:
Background
Usage of the
allOf
constraint describes a JSON schema that must match all subschemas defined, which I've seen used as a way to compose multiple schemas or share a common base model.Note from JSON schema docs:
The PetStore Expanded 3.0 spec has an example of this:
Proposal
I'm wondering for something like above if we can consider the schema as both of them combined, for the example above:
Original
Combined
Possible IR output
Notes
allOf
use-cases we'd need to determine how to handleallOf
keyword can appear anywhere, not just in the root of the schema like shown above 😄 , will need to consider that