feat: add HTTP QUERY method support#4902
Open
bizprat wants to merge 1 commit into
Open
Conversation
6ed649f to
c0a988b
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4902 +/- ##
=======================================
Coverage 67.28% 67.29%
=======================================
Files 293 293
Lines 15226 15234 +8
Branches 1727 1727
=======================================
+ Hits 10245 10251 +6
- Misses 4834 4836 +2
Partials 147 147 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c0a988b to
4ee6036
Compare
provinzkraut
reviewed
Jul 9, 2026
Signed-off-by: Prateek Anand <bizprat@gmail.com>
4ee6036 to
28e214d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HttpMethod.QUERYand first-class@queryroute decorator exportsRequestFactory.query()support for tests and request constructionQUERYas a CSRF safe method by default@queryexcluded from OpenAPI 3.1 schema output by default, leaving OpenAPI 3.2 path item support as a separate follow-upCloses #4626.
Verification
uv run --python 3.13 pytest tests/unit/test_openapi/test_typescript_converter/test_converter.py tests/unit/test_cli/test_schema_commands.pyuv run --python 3.13 pytest tests/e2e/test_query_method.py tests/e2e/test_router_registration.py tests/e2e/test_option_requests.py tests/unit/test_data_extractors.py tests/unit/test_middleware/test_csrf_middleware.py tests/unit/test_openapi/test_path_item.pyuv run --python 3.13 ruff format --check litestar tests/e2e/test_query_method.py tests/unit/test_data_extractors.py tests/unit/test_middleware/test_csrf_middleware.py tests/unit/test_openapi/test_path_item.py tests/unit/test_openapi/test_typescript_converter/test_converter.py tests/unit/test_cli/test_schema_commands.pyuv run --python 3.13 ruff check litestar tests/e2e/test_query_method.py tests/unit/test_data_extractors.py tests/unit/test_middleware/test_csrf_middleware.py tests/unit/test_openapi/test_path_item.py tests/unit/test_openapi/test_typescript_converter/test_converter.py tests/unit/test_cli/test_schema_commands.pyuv run --python 3.13 pyright litestar/enums.py litestar/types/asgi_types.py litestar/handlers/http_handlers/decorators.py litestar/testing/request_factory.py litestar/_openapi/typescript_converter/converter.py tests/e2e/test_query_method.py tests/unit/test_data_extractors.py tests/unit/test_middleware/test_csrf_middleware.py tests/unit/test_openapi/test_path_item.py tests/unit/test_openapi/test_typescript_converter/test_converter.py tests/unit/test_cli/test_schema_commands.pyuv run --python 3.13 mypy litestar/enums.py litestar/types/asgi_types.py litestar/handlers/http_handlers/decorators.py litestar/testing/request_factory.py litestar/_openapi/typescript_converter/converter.py tests/e2e/test_query_method.py tests/unit/test_data_extractors.py tests/unit/test_middleware/test_csrf_middleware.py tests/unit/test_openapi/test_path_item.py tests/unit/test_openapi/test_typescript_converter/test_converter.py tests/unit/test_cli/test_schema_commands.pyuv run --python 3.13 pre-commit run --files litestar/__init__.py litestar/config/csrf.py litestar/enums.py litestar/handlers/__init__.py litestar/handlers/http_handlers/__init__.py litestar/handlers/http_handlers/decorators.py litestar/testing/request_factory.py litestar/types/asgi_types.py litestar/_openapi/typescript_converter/converter.py tests/unit/test_data_extractors.py tests/unit/test_middleware/test_csrf_middleware.py tests/unit/test_openapi/test_path_item.py tests/unit/test_openapi/test_typescript_converter/test_converter.py tests/unit/test_cli/test_schema_commands.py tests/e2e/test_query_method.py📚 Documentation preview 📚: https://litestar-org.github.io/litestar-docs-preview/4902