feat: refactor to strongly typed explicit parameters and explicit error handling#8
feat: refactor to strongly typed explicit parameters and explicit error handling#8
Conversation
… returns - Refactored `Creator`, `Reader`, `Updater`, `Deleter`, and `DataValidator` interfaces to replace variadic `data ...any` with explicitly typed parameters (`payload any`, `id string`) and strict error returns. - Added `List() (any, error)` to `Reader` interface to resolve ambiguity in generic reads. - Updated `CallHandler` logic to correctly iterate, filter out system injected objects (`*http.Request`, `context.Context`), and extract the precise payload before delegation. - Removed `github.com/tinywasm/binary` as the default codec in `crudp.go` and from the dependencies, enforcing explicit codec configuration. - Migrated tests (`shared_test.go`, `integration_stlib_test.go`) to utilize `github.com/tinywasm/json`. - Updated docs, example applications, and integration test mocks to reflect the new API and "Handler Wrapper" design pattern. Co-authored-by: cdvelop <44058491+cdvelop@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Implement the refactoring proposed in
docs/PLAN.mdto introduce strongly typed parameters for core CRUD interfaces, removing the problematicdata ...anypattern and implicitly handled errors.Changes Include:
interfaces.gowithCreate(payload any) (any, error),Read(id string) (any, error),List() (any, error),Update(payload any) (any, error),Delete(id string) error.CallHandlerpayload extraction to properly ignore internal injection structures like*http.Requestand find the accurate request payload.tinywasm/binary) and configured testing exclusively usingtinywasm/jsonas requested.userCRUDwrapper pattern.PR created automatically by Jules for task 6641959686492189938 started by @cdvelop