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
fix: support list and map element types in compareSlice for delta code generation (#675)
## Fix: Support list/map element types in compareSlice for delta code generation
### Problem
Code generation fails when a resource has a field that is a list-of-lists or list-of-maps. The `compareSlice` function in `compare.go` only handled `string`, `structure`, and `union` element types, returning an error for `list` and `map` types:
```
field "Spec.RowLevelPermissionTagConfiguration.TagRuleConfigurations": unsupported element type in compareSlice: list
```
This blocked generating the QuickSight `DataSet` resource, where `TagRuleConfigurations` is `[][]*string`.
### Fix
Added `list` and `map` as supported element types in `compareSlice`, using `equality.Semantic.Equalities.DeepEqual` for comparison — the same approach already used for `structure` and `union` types.
### Testing
- Added `TestCompareResource_QuickSight_DataSet` with a minimal QuickSight Smithy model containing just the DataSet CRUD shapes
- Test validates the exact field (`TagRuleConfigurations`) that triggered the original error
- All existing compare tests continue to pass
### Changes
- `pkg/generate/code/compare.go` — added `list`, `map` case to `compareSlice`
- `pkg/generate/code/compare_test.go` — added QuickSight DataSet test
- `pkg/testdata/` — added QuickSight test model and generator config
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
if len(a.ko.Spec.RowLevelPermissionTagConfiguration.TagRuleConfigurations) != len(b.ko.Spec.RowLevelPermissionTagConfiguration.TagRuleConfigurations) {
} else if len(a.ko.Spec.RowLevelPermissionTagConfiguration.TagRuleConfigurations) > 0 {
731
+
if !equality.Semantic.Equalities.DeepEqual(a.ko.Spec.RowLevelPermissionTagConfiguration.TagRuleConfigurations, b.ko.Spec.RowLevelPermissionTagConfiguration.TagRuleConfigurations) {
} else if len(a.ko.Spec.RowLevelPermissionTagConfiguration.TagRules) > 0 {
738
+
if !equality.Semantic.Equalities.DeepEqual(a.ko.Spec.RowLevelPermissionTagConfiguration.TagRules, b.ko.Spec.RowLevelPermissionTagConfiguration.TagRules) {
0 commit comments