Repository navigation
Record that StrictBaseModel is for request bodies only - #75639
Merged
Merged
Conversation
The seven response models that moved back to BaseModel in apache#75610 had picked StrictBaseModel because its docstring reads as a general recommendation: use it where extra fields should not be accepted. Nothing at the class recorded why that is limited to request bodies. A response model is instantiated from a source object that holds more than it returns, so forbidding extra fields rejects its own construction; and the setting reaches generated clients as additionalProperties: false, so an older airflowctl rejects a field a newer server adds. The second reason is what apache#75610 had to fix, and neither was written down where the next response model would look.
henry3260
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
October 26, 2026 06:07
Andrushika
approved these changes
Oct 27, 2026
henry3260
enabled auto-merge (squash)
October 30, 2026 18:14
jason810496
approved these changes
Nov 1, 2026
jason810496
left a comment
Member
There was a problem hiding this comment.
Thanks for the follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#75610 moved seven response-only models off
StrictBaseModel, but left the class itself untouched. Its docstring says to use it for "models that should not have any extra fields in the payload", which reads as a general recommendation — and is how those seven came to pick it.Two reasons limit it to request bodies, and neither is recorded at the class:
extra="forbid"rejects the construction, which is what forbid extra fields in BaseModel #44306 worked around when it split the two base classes.extra="forbid"reaches the spec asadditionalProperties: false, so a generated client such as airflowctl rejects a field that a newer server adds. That is the failure Stop airflowctl from failing on fields added by newer API servers #75610 had to fix.What
The docstring states the constraint and both reasons. No behaviour change, no other file touched.
related: #75610
Was generative AI tooling used to co-author this PR?