3 ms·
Since you use python you might be interested in knowing that Pydantic outputs JSON Schema as an option. This is part of how FastAPI is able to generate OpenAPI
by tedivm 4y ago
Since you use python you might be interested in knowing that Pydantic outputs JSON Schema as an option. This is part of how FastAPI is able to generate OpenAPI specs (OpenAPI uses JSON Schema for a lot of validation). The only time I've needed to use JSON Schema I just used Pydantic models as my source of truth.
- ok123456 4y agoI use pydantic, and then use the json schema output to generate typescript interface definitions. This gives me pretty good velocity by having a single ground truth. The application I'm working on predates FastAPI, so I'm using CherryPy and modified their JSON tool to call the parse_obj() and json() on the model where needed.