I don’t know of a lot better pattern for checking ...
# random
o
I don’t know of a lot better pattern for checking code and enforcing it statically other than changing types. So I usually deserialize json into typed object with validation included.