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
Support custom generic container types in v2 #5019
Comments
Should be able to cover this with the same logic we use for deque. |
I think actually we maybe shouldn't support this (though we should make sure we provide a better error) out of the box, but should instead raise an error message that links to documentation for how to implement The gist I link in this comment: #2274 (comment) shows how to create a non-contrived pydantic core schema for a custom generic container, I think we should put something like this in the docs and ideally link to it in the error message. (In this PR: #5629 I implement similar "error for custom generic containers" logic specifically for subtypes of |
It's a bit unclear to me what the original issue is asking for. I see two different things going on:
So this issue is resolved unless I'm missing something. |
In v2, currently the following code:
results in:
I believe support for custom generic containers was added to v1.X by PR #2554; that PR referenced this comment: #2465 (comment) as providing its motivation.
The text was updated successfully, but these errors were encountered: