OSIS generator: service method wrapper naming collision across services #12
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_rpc#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The OSIS code generator creates convenience wrapper methods on the domain struct using only the method name without a service prefix. When multiple services define methods with the same name (
list,create,get, etc.), the generated code has duplicate method definitions that don't compile.Example:
Location
hero_rpc/crates/generator/src/rust/rust_osis.rs— the method generation doesn't prefix with the service name.Suggested Fix
Prefix generated convenience methods with the service name:
Or generate them in a service-scoped impl block or module.
Current Workaround
In the freezone project, we removed the convenience methods entirely from the generated code and use qualified RPC dispatch (
contractservice.sign_contractviahandle_rpc()). This works but means the type-safe convenience methods aren't available.See: znzfreezone_code/home#34
Impact
Any project with multiple services that have overlapping method names hits this. The workaround (removing convenience methods) is functional but loses the ergonomic API.