Change in behavior in Annotated validations in 0.115.10 #13431
-
First Check
Commit to Help
Example Codefrom typing import Annotated
from pydantic import AfterValidator
from fastapi import FastAPI
app = FastAPI()
def validator(v):
raise ValueError()
Ints = Annotated[list[int], AfterValidator(validator)]
@app.post("/")
def post(ints: Ints) -> None:
return NoneDescriptionIf we run the code and send a request to the endpoint, e.g. on version 0.115.9, we get a 422 but on 0.115.10 we get 200. Is this a bug? Operating SystemLinux Operating System DetailsNo response FastAPI Version0.115.10 Pydantic Version2.9.2, 2.10.6 Python Version3.12 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
|
I think this is a similar issue after upgrading to version 0.115.10 On 0.115.9 this returns: But on 0.115.10 this returns: |
Beta Was this translation helpful? Give feedback.
-
|
Also noticing a change in behaviour for apache/airflow. We have an API that does this: For 0.115.9 we see: But for 0.115.10, we see: |
Beta Was this translation helpful? Give feedback.
-
|
Yeah. Looking at the changelog, we do not see much of the reason why it would change |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the clear report with a minimal reproducible example @amacfie-tc! 🚀 This is indeed a bug, I'll continue the process in this issue: #13440 I'm investigating and a solution will be released shortly. 🤓 Thanks @luzzodev for bringing my attention to this ☕ |
Beta Was this translation helpful? Give feedback.
Thank you for the clear report with a minimal reproducible example @amacfie-tc! 🚀
This is indeed a bug, I'll continue the process in this issue: #13440
I'm investigating and a solution will be released shortly. 🤓
Thanks @luzzodev for bringing my attention to this ☕