so1n/pait

No longer restricting key parameters of routing

Closed this issue · 0 comments

so1n commented

In the current version, the following routing parameters are not supported:

from pait.app.any import pait

class Demo(object):
    pass


@pait()
def demo(a: int = Demo()):
    pass

This type of parameter will now be supported, and when this type of parameter is used, it will be preferred to see if there is an a value in the context's kwargs, and if there is, it will be used directly, otherwise the value of the a variable will be Demo().