News for hackers. Stuff that matters.
Re:I use Attrs instead of Pydantic by zmmmmm on Thursday August 26, 2021 @06:40AM (#28313047)
Quick look and from what I can see attrs/cattrs can't generate jsonschema => game over.
Re:I use Attrs instead of Pydantic by KptMarchewa on Thursday August 26, 2021 @07:18AM (#28313344)
It 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.

Re:I use Attrs instead of Pydantic by zmmmmm on Thursday August 26, 2021 @06:14PM (#28321666)
I 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.
Re:I use Attrs instead of Pydantic by jensus on Thursday August 26, 2021 @07:45AM (#28313616)
had generally good experience creating typed wrappers for api's with json-schema-to-pydantic[0] converter

[0] https://github.com/koxudaxi/datamodel-code-generator

Re:I use Attrs instead of Pydantic by BerislavLopac on Thursday August 26, 2021 @08:39PM (#28322950)
That's what warlock does.