You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support custom nested fields that have path that contains types other than struct (#538)
Issue #, if available:
Description of changes:
Say we want to overwrite a nested field type e.g. for `WAFv2` controller (this is needed due to a cyclic dependency):
```
resources:
RuleGroup:
Rules.Statement.AndStatement:
type: string
```
Currently, the [overwrite code logic](https://github.com/aws-controllers-k8s/code-generator/blob/62466746500d0c01fcfa8e8e3ca6abd9386e4687/pkg/model/crd.go#L660-L687) does not work for the above scenario and it returns the following error:
```
Expected parent field to be of type structure, but found list
```
This happens because `Rules` is not of type `struct`, but `[]struct`, and the referenced code logic requires that all fields within the path (i.e. `Rules` and `Statement` to be of type `struct`).
This PR relaxes the logic to allow fields within the path to also be of types `[]struct` and `map[]struct`.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
0 commit comments