Skip to content

Commit

Permalink
Update reflections.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilrybacki authored Jul 15, 2024
1 parent 66cd98a commit d441bad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/content/articles/reflections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ the input data. It also allows You to serialize and deserialize those models to
However, these JSON schemas do not contain information about one of the most flexible aspects of data validation - the **custom validators**,
which can be defined **programmatically** in the Python code. So that is one of the issues that I want to tackle.

Also, while on the topic of allowing custom validators, I want their definitions to be as **flexible** as possible,
Being on the topic of allowing custom validators, I want their definitions to be as **flexible** as possible,
while remembering that somebody can use a cheeky `eval` to inject some malicious code into the system or
`shutil.rmtree` to delete the whole filesystem.

Also, when You dump a Pydantic model to JSON, the schema is often not very human-readable and it is not easy to
maintain it in a repository. I want to structure my schema definitions in such a way, that a maintainer can easily
see which fields are required, which are optional, which have default values, which are of a specific type and which
are basically nested schemas themselves. Also, YAML has a couple of nice tricks up its sleeve such as **anchors** and
are basically nested schemas themselves. Additionally, YAML has a couple of nice tricks up its sleeve such as **anchors** and
**references** that can be used to define a schema in a more [DRY way].

### How it do? 🤔
Expand Down

0 comments on commit d441bad

Please sign in to comment.