Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23160

How to create routes with FastAPI within a class and classy-fastapi - followup

$
0
0

I am using classy_fastapi for a while now but noticed that routes are not carried over in sub classes? is that expected behaviour ?i.e.

class A(Routable): def __init__():    super().__init__()   @get('/user')   def get_user():      return "some user"
class B(A):   def __init__():    super().__init__()  @get('/company')  def get_company():      return "company"

The instance of class B won't know about route '/user'.

Any ideas?

Expecting that routes are available in instances of sub class.


Viewing all articles
Browse latest Browse all 23160

Trending Articles