From 3d6f69d29dbc2f5f16d47f60f04cefd78e4244e4 Mon Sep 17 00:00:00 2001 From: Pastukhov Nikita Date: Thu, 7 Mar 2024 21:29:55 +0300 Subject: [PATCH] docs: add apply_types warning notice to subscription/index.md (#1291) --- docs/docs/en/getting-started/subscription/index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/en/getting-started/subscription/index.md b/docs/docs/en/getting-started/subscription/index.md index 5ca412a1af..e1ae7ecef2 100644 --- a/docs/docs/en/getting-started/subscription/index.md +++ b/docs/docs/en/getting-started/subscription/index.md @@ -33,12 +33,16 @@ Generally, **FastStream** uses your function type annotation to serialize incomi You can also access some extra features through the function arguments, such as [Depends](../dependencies/index.md){.internal-link} and [Context](../context/existed.md){.internal-link} if required. -However, you can easily disable Pydantic validation by creating a broker with the following option `#!python Broker(apply_types=False)` (this also disables Context and Depends features). +However, you can easily disable **Pydantic** validation by creating a broker with the following option `#!python Broker(apply_types=False)` This way **FastStream** still consumes `#!python json.loads` result, but without pydantic validation and casting. {! includes/getting_started/subscription/index/3.md !} +!!! warning + Setting the `apply_types=False` flag not only disables type casting but also `Depends` and `Context`. + If you want to disable only type casting, use `validate=False` instead. + ## Multiple Subscriptions You can also subscribe to multiple event streams at the same time with one function. Just wrap it with multiple `#!python @broker.subscriber(...)` decorators (they have no effect on each other).