4 ms·
Quick look and from what I can see attrs/cattrs can't generate jsonschema => game over.
by zmmmmm 5y ago
Quick look and from what I can see attrs/cattrs can't generate jsonschema => game over.
- KptMarchewa 5y agoIt would be better in the other way. Generate sane python models with it using existing jsonschema - similar to stuff like grpc, but without extra bits. The existing generators are generally terrible.
- jensus 5y agohad generally good experience creating typed wrappers for api's with json-schema-to-pydantic[0] converter [0] https://github.com/koxudaxi/datamodel-code-generator https://github.com/koxudaxi/datamodel-code-generator
- zmmmmm 5y agoI wish json-schema was nicer to write and if it was I would do that. However its way too unfriendly, so using something like PyDantic models as the "source of truth" is much easier, and at least lets other clients generate definitions and validate their inputs / outputs even if the generated schemas aren't perfect.
- BerislavLopac 5y agoThat's what warlock does.