Nested directives do not work
Spenhouet opened this issue · comments
Sebastian Penhouet commented
We want to use directives in directives (nested directives).
We simply did expect this to work but seemingly it doesn't.
Is this not supported or are we doing something wrong?
Minimal working example:
import hug
@hug.directive()
def inner(*args, **kwargs):
return 'inner'
@hug.directive()
def outer(inner: inner, *args, **kwargs):
return 'outer with ' + str(inner)
@hug.get()
def test_route(outer: outer):
return outer
This will fail with:
TypeError: outer() missing 1 required positional argument: 'inner'