Open
Description
Passing data to templates using structs is not scalable. For every customization that needs a new field, we need to add a new exported field to either API, Package or InterfaceWrapper struct.
Reference: https://github.com/kcp-dev/code-generator/blob/main/pkg/internal/parser.go#L51-L73
Initializing a new struct and passing info for templates:
Instead of this convoluted process, inspired from upstream code-gen use a map[string]inteface{}
and keep adding new keys for any additional fields.
Reference: https://github.com/kubernetes/code-generator/blob/7d977b3e5454e47ec6b903242616e9ea62644226/cmd/client-gen/generators/generator_for_type.go#L147
Metadata
Metadata
Assignees
Labels
No labels