Skip to content

Commit

Permalink
Fix docs on JSON type (#7189)
Browse files Browse the repository at this point in the history
Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
  • Loading branch information
Kludex and dmontagu committed Aug 21, 2023
1 parent 8989f96 commit acda994
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/usage/types/json.md
Expand Up @@ -4,7 +4,7 @@
You can use the `Json` data type to make Pydantic first load a raw JSON string before
validating the loaded data into the parametrized type:

```py group='json'
```py group="json"
from typing import Any, List

from pydantic import BaseModel, Json, ValidationError
Expand Down Expand Up @@ -59,7 +59,7 @@ except ValidationError as e:
When you dump the model using `model_dump` or `model_dump_json`, the dumped value will be the result of validation,
not the original JSON string. However, you can use the argument `round_trip=True` to get the original JSON string back:

```py group='json'
```py group="json"
print(ConstrainedJsonModel(json_obj='[1, 2, 3]').model_dump_json())
#> {"json_obj":[1,2,3]}
print(
Expand Down

0 comments on commit acda994

Please sign in to comment.