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

Routing Fails when request not declared as param #3012

Open
1 task done
Goldziher opened this issue Dec 2, 2024 · 0 comments
Open
1 task done

Routing Fails when request not declared as param #3012

Goldziher opened this issue Dec 2, 2024 · 0 comments
Labels

Comments

@Goldziher
Copy link

Goldziher commented Dec 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

async def handle_generate_draft_request(application_id: UUID) -> HTTPResponse:

If i do not declare a request parameter in the route handler, the server throws 500.

This works:

async def handle_generate_draft_request(request: Request, application_id: UUID) -> HTTPResponse:

As does this:

async def handle_generate_draft_request(_, application_id: UUID) -> HTTPResponse:
  • note, i have no use for the request object in this particular case. Hence I omitted it.

Code snippet

async def handle_generate_draft_request(application_id: UUID) -> HTTPResponse:
pass

Expected Behavior

I am able to not declare the request object. Inspection should suffice to determine this.

How do you run Sanic?

Sanic CLI

Operating System

Linux

Sanic Version

latest

Additional context

No response

@Goldziher Goldziher added the bug label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant