@@ -86,7 +86,7 @@ type IResource interface {
8686
8787 // [Optional] KeyedSlices returns a map from path patterns to KeyFunc for comparing slices by key instead of by index.
8888 // Example: func (*ResourcePermissions) KeyedSlices(state *PermissionsState) map[string]any
89- KeyedSlices (state any ) map [string ]any
89+ KeyedSlices () map [string ]any
9090}
9191
9292// Adapter wraps resource implementation, validates signatures and type consistency across methods
@@ -202,18 +202,7 @@ func loadFieldTriggers(triggerCall *calladapt.BoundCaller, isLocal bool) (map[st
202202
203203// loadKeyedSlices validates and calls KeyedSlices method, returning the resulting map.
204204func loadKeyedSlices (call * calladapt.BoundCaller ) (map [string ]any , error ) {
205- // Validate signature: func(stateType) map[string]any
206- if len (call .InTypes ) != 1 {
207- return nil , fmt .Errorf ("KeyedSlices must take exactly 1 parameter, got %d" , len (call .InTypes ))
208- }
209- expectedReturnType := reflect .TypeOf (map [string ]any {})
210- if len (call .OutTypes ) != 1 || call .OutTypes [0 ] != expectedReturnType {
211- return nil , fmt .Errorf ("KeyedSlices must return map[string]any, got %v" , call .OutTypes )
212- }
213-
214- // Create a nil pointer of the expected type (KeyedSlices implementations should not depend on the state value)
215- nilArg := reflect .Zero (call .InTypes [0 ]).Interface ()
216- outs , err := call .Call (nilArg )
205+ outs , err := call .Call ()
217206 if err != nil {
218207 return nil , fmt .Errorf ("failed to call KeyedSlices: %w" , err )
219208 }
0 commit comments