Open IfSentient opened 2 days ago
However, there are definitely use-cases for recursive types within app platform
Do we have any real requests / questions / examples?
Do we want to only generate code for the recursive types, and use kubernetes-preserve-unknown-fields: true on an empty object when generating the schema (as suggested in https://github.com/kubernetes-sigs/controller-tools/issues/585?
I would prefer that for a V1 / V0 approach. We could start there and investigate changing apiextensions code to support recursive types natively later.
Because CRDs cannot handle recursive types natively, we do not currently support recursive codegen from the CLI ("do not currently support" in this case means "CLI freezes up when CUE attempts to convert the recursive CUE type to OpenAPI). However, there are definitely use-cases for recursive types within app platform, so we should evaluate if we want to support recursive types in any possible case. Some questions:
kubernetes-preserve-unknown-fields: true
on an empty object when generating the schema (as suggested in this kubernetes issue? We could use webhook validation to check that the actual data is correct on create/update.