WinterFramework / winter

Web Framework with focus on python typing, dataclasses and modular design
MIT License
17 stars 18 forks source link

Deprecate winter.controller annotation #227

Closed mofr closed 2 years ago

mofr commented 2 years ago

Is your feature request related to a problem? Please describe. The annotation is functionally unnecessary and should be removed avoid reduce clutter in the code.

Describe the solution you'd like Any class method with winter route should be able to act as an endpoint.

Additional context The following code should work fine

import winter

# No winter.controller here
class HelloWorldAPI:
    @winter.route_get('/hello/')
    def hello(self) -> str:
        return 'Hello, world!'

Probably the next step would be to allow routing free functions without classes.