Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subrouters and add_view combined to use the expectation seems different from what I expected? #1085

Open
WaterEmissary opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@WaterEmissary
Copy link

Bug Description

project/view/view_api.py

from robyn import SubRouter, Request

view_sub = SubRouter(__name__, "/view_api")

@view_sub.view("/decorator")
async def decorator_view(request: Request):
    async def get():
        return "get"

    async def post():
        return "post"


async def def_view(request: Request):
    async def get():
        return "get"

    async def post():
        return "post"

view_sub.add_view("/def_view", def_view)

@view_sub.get('/te')
def index_view(request: Request):
    return "index"

RUN INFO:
INFO:robyn.logger:Added route HttpMethod.GET /decorator
INFO:robyn.logger:Added route HttpMethod.POST /decorator
INFO:robyn.logger:Added route HttpMethod.GET /def_view
INFO:robyn.logger:Added route HttpMethod.POST /def_view
INFO:robyn.logger:Added route HttpMethod.GET /view_api/te

Why is the route /decorator but not /view_api/decorator

Steps to Reproduce

No response

Your operating system

None

Your Python version (python --version)

None

Your Robyn version

None

Additional Info

No response

@WaterEmissary WaterEmissary added the bug Something isn't working label Dec 13, 2024
@dave42w
Copy link
Contributor

dave42w commented Dec 13, 2024

I'm pretty new to Robyn. However, it seems to me that views haven't got much love and they are now out of date with newer features like authentication (and it now seems subrouters) not supported.

I suggested a while ago that we depreciate them. #1068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants