-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list class not allowed in pydantic nested schema default #68
Comments
@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
The text was updated successfully, but these errors were encountered: