Object arguments #5

Open
opened 2026-05-06 06:59:47 +02:00 by c.fahner · 0 comments
Owner

Currently only a limited set of scalar arguments to HTTP resources are supported: strings, ints, floats and bools. Anything else requires creating a custom "extractor."

It should be possible to use custom classes as parameter type to the #[Method] annotated functions of HTTP resources. Similar to dependency injection, the constructor arguments of new instances of these object arguments will be (recursively) populated according to the constructor definition using reflection.

One major difference with DI is that the object arguments may not be lazily instantiated, as incorrect HTTP arguments may indicate a security issue.

Currently only a limited set of scalar arguments to HTTP resources are supported: strings, ints, floats and bools. Anything else requires creating a custom "extractor." It should be possible to use custom classes as parameter type to the `#[Method]` annotated functions of HTTP resources. Similar to dependency injection, the constructor arguments of new instances of these object arguments will be (recursively) populated according to the constructor definition using reflection. One major difference with DI is that the object arguments may not be lazily instantiated, as incorrect HTTP arguments may indicate a security issue.
c.fahner added this to the v0.2 milestone 2026-05-06 06:59:47 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slendium/framework#5
No description provided.