Would you generate a schema from the type annotations so that other languages can use the data?
JSON is really not the most efficient data representation for round-tripping to and from Python. A binary format (or pickle without arbitrary code execution) would solve for Python object > file > Python object.
IMHO, JSON is most useful when the data needs to be read/written from (browser-side) JS, too.
And then you need data validation for user-supplied input (which is not distinct from the deserialization problem). E.g. DRF has data validation. But (mypy) type annotations are insufficient for data validation: compare JSONschema and the maximum amount of information storable in mypy-compatible type annotations, for example.
Data validation needs to return errors in a feedback loop with the user, so it's sort of more than just the preconditions that need to be satisfied before a function proceeds.
- serialization from Python (TA useful)
- deserialization with the same Python code (TA useful)
- deserialization with other Python code (insufficient)
- deserialization with other languages (insufficient)
- form generation (insufficient)
- data validation (insufficient)
- preconditions (insufficient)
So, IMHO type annotations are not insufficient and thus redundant and not elegant.