Skip to content

Commit

Permalink
docs: add apply_types warning notice to subscription/index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Mar 7, 2024
1 parent a2fd2f1 commit f0cb51c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/docs/en/getting-started/subscription/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit f0cb51c

Please sign in to comment.