Uh oh!
There was an error while loading. Please reload this page.
Document HTTP statuses that API routes raise but never declared - #71011
Conversation
bbovenzi
commented
Aug 4, 2026
What does 404 on a POST variable endpoint mean? |
a92144a to
dbdebe5CompareSorry about that. It doesn't mean anything on a create endpoint. I found these with a script that compares the statuses each handler raises against the ones its I've removed the branch. If the read-back ever did come back empty, response validation now gives a 500, which is the right answer for a write that silently didn't happen. The description is updated too: that row is gone, and the table now says when each of the remaining statuses is returned. Thanks for your review! |
dbdebe5 to
6b419f7CompareThere was a problem hiding this comment.
Nice! Thanks for adding the missing status code.
I found these with a script that compares the statuses each handler raises against the ones its create_openapi_http_exception_doc(...) declares, so the list is everything that had drifted.
I prefer to introduce the script you mentioned as pre-commit (prek) hook static check (please take the dev/script as referece) that ensure all the status code that might raise within the route are documented in the router definition level to prevent the further drift from happening again instead of one-time manual fix.
Which means we might need to walk into the module level (e.g. the exception might be raise within the common function that we imported at router level).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
6b419f7 to
53959b0CompareColtenOuO
commented
Aug 6, 2026
Thanks again! Reverted the post_variable change. This PR now only adds |
Handlers raise statuses that create_openapi_http_exception_doc never declares, so the generated spec — and every client built from it — has no model for a response the API really returns.
53959b0 to
4b34d9dCompareColtenOuO
commented
Aug 13, 2026
rebase to lastest |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Thanks for the PR, LGTM.
Uh oh!
There was an error while loading. Please reload this page.
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…clared (#71011) (#71622) Handlers raise statuses that create_openapi_http_exception_doc never declares, so the generated spec — and every client built from it — has no model for a response the API really returns. (cherry picked from commit 7c0b3e6) Co-authored-by: Jyun-An Chen <jun930436@gmail.com>
Follow-up to #67570, #67571 and #70992, which each fixed one instance of the same
drift: a handler raises an HTTP status that
create_openapi_http_exception_doc(...)never declares, so the generated spec — and every client built from it — has no model
for a response the API really returns.
POST /backfills/dry_run400allowed_run_typesexcludesbackfillDELETE /dags/{dag_id}/dagRuns/{dag_run_id}409DagRunMutableStatesGET /dags/{dag_id}/dagRuns400partition_datefilter withdag_id=~, or against a non-partitioned DagDELETE /dags/{dag_id}409PATCH /hitlDetails/{dag_id}/{dag_run_id}/{task_id}400chosen_optionsoutsideoptions, or several sent to a non-multipledetailPOST /dags/{dag_id}/clearTaskInstances400past/futurewith a run that has no logical dateGET /ui/dags/{dag_id}/latest_run400dag_id=~GET /ui/dependencies400dependency_type=datawith a missing or non-numericasset:node idEach is driven by request input or by persisted state, so each is really returned today.
ui/dependencies.pyalso had one bareraise HTTPException(404, ...); it now usesstatus.HTTP_404_NOT_FOUND, the same tidy-up as #67571.xcom.pyis deliberately left out — it is fixed in #70992.Behaviour
Otherwise unchanged: only
responses=declarations, so the regenerated spec and UIclient are additive (6 additions to the public spec, 2 to
_private_ui.yaml, nodeletions). No new tests — the statuses were already produced and are already covered.
Was generative AI tooling used to co-author this PR?