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
I'm looking for a way to override/customize the behavior of the compute_route_parameters method in RouteContext (to transform/decode sqids into database IDs for incoming route parameters before business logic).
Currently, it seems that Ninja Extra uses a global helper function get_route_execution_context which instantiates and returns a RouteContext. I tried to replace this globally with my custom implementation but get Import Errors and it doesn't feel like the correct way to do it either.
Any guidance on how to plug in a custom sub-classed RouteContext or a feature request to allow for this customization in a clean, configurable way would be greatly appreciated. Also let me know if there's a better way to handle transforming incoming data before it hits the business logic of API routes.
Thank you!
The text was updated successfully, but these errors were encountered:
@krizh-p There is no way to extend it at the moment but I will have something in next release. The context class will be registered in NINJA_EXTRA settings.
I'm looking for a way to override/customize the behavior of the
compute_route_parameters
method inRouteContext
(to transform/decode sqids into database IDs for incoming route parameters before business logic).Currently, it seems that Ninja Extra uses a global helper function
get_route_execution_context
which instantiates and returns aRouteContext
. I tried to replace this globally with my custom implementation but get Import Errors and it doesn't feel like the correct way to do it either.Any guidance on how to plug in a custom sub-classed
RouteContext
or a feature request to allow for this customization in a clean, configurable way would be greatly appreciated. Also let me know if there's a better way to handle transforming incoming data before it hits the business logic of API routes.Thank you!
The text was updated successfully, but these errors were encountered: