cog
52550a77 - Annotate nullable values as such in the OpenAPI schema (#2316)

Commit
275 days ago
Annotate nullable values as such in the OpenAPI schema (#2316) * Annotate nullable values as such in the OpenAPI schema Prior to this change, we allowed the return of `None` values from models, serializing them as `null`, but the schema didn't specify them as nullable, which would cause model output to fail validation. This only supports Pydantic V2, because, from what I can tell, Pydantic V1 doesn't give us any clues that a field allows `None` values. * Support nullable: true in pydantic v1 * Support output types nullable in pydantic v1 * Fix lint * Remove input_seed * Simplify nullable fields --------- Co-authored-by: Will Sackfield <sackfield@replicate.com>
Author
Parents
Loading