Closed dada-engineer closed 8 months ago
@faph this is a problem when having an empty list in defaults. We could not instantiate this sequence schema even if we can detect the type correctly as the constructor requires at least one element in the list.
I'd suggest for now to use schema_obj(value.class) only if the value is supported by any schema.
EDIT: otherwise we'd use the value as is.
Sorry correction, we should just use the pydantic schema annotations instead of value.class. Then it works
@faph would be great to have this fix quite soon 😊 sorry for the hurry / pushy behaviour 🙈
That's ok @dada-engineer. Left a few minor comments
I have a class of type pydantic.BaseModel with a chiled pydantic Basemodel with a list attribute.
This is not serializable right now
Traceback:
relates to handling of pydantic defaults in #64