Skip to content
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

Allow extra fields from clients #85

Open
ryanfaircloth opened this issue Nov 27, 2024 · 2 comments
Open

Allow extra fields from clients #85

ryanfaircloth opened this issue Nov 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ryanfaircloth
Copy link

extra="forbid",

For server implementations clients often send fields not permitted or defined in the model This is unfortunate however for compatibility we need to allow but ignore fields we don't support

@azmeuk azmeuk added the enhancement New feature or request label Nov 28, 2024
@azmeuk
Copy link
Contributor

azmeuk commented Nov 28, 2024

Interesting.
In the end, depending on the context, one might want the extra param to be lax (for servers or clients analyzing incoming data) or to be strict (when servers or clients produce data to be sent, or for compliance testers). I wonder if Pydantic would allow this parameter to be dynamic.

@azmeuk
Copy link
Contributor

azmeuk commented Dec 6, 2024

I opened a ticket upstream. pydantic/pydantic#11057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants