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

Bug: normal usage of route handler decorators causes deprecation warnings #3552

Closed
1 of 4 tasks
bunny-therapist opened this issue Jun 7, 2024 · 2 comments · Fixed by #3569
Closed
1 of 4 tasks

Bug: normal usage of route handler decorators causes deprecation warnings #3552

bunny-therapist opened this issue Jun 7, 2024 · 2 comments · Fixed by #3569
Labels
Bug 🐛 This is something that is not working as expected

Comments

@bunny-therapist
Copy link

bunny-therapist commented Jun 7, 2024

Description

Using any of the route handler decorators get, post, etc now causes the warning "Semantic HTTP route handler classes are deprecated and will be replaced by functional decorators in Litestar 3.0.

I was told here that this is not intended behavior and I should create this issue.

URL to code causing the issue

class _SubclassWarningMixin:

MCVE

# Run this file with pytest

from litestar import Litestar, get


@get()
async def root_handler() -> None: ...


app = Litestar(route_handlers=[root_handler])


def test_nothing():
    ...

Steps to reproduce

1. Install litestar 2.9.0
2. Put the MCVE in a file
3. Run pytest on that file
4. Deprecation warnings appear in the output.

Screenshots

"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

No response

Litestar Version

2.9.0

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@bunny-therapist bunny-therapist added the Bug 🐛 This is something that is not working as expected label Jun 7, 2024
Copy link

This issue has been closed in #3569. The change will be included in the upcoming patch release.

Copy link

github-actions bot commented Jan 8, 2025

A fix for this issue has been released in v2.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 This is something that is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant