Skip to content

Fix GET /pools list endpoint incorrectly documenting 404 in OpenAPI spec - #67570

Merged
vincbeck merged 3 commits into
apache:mainfrom
ColtenOuO:fix-get-pools-incorrect-404-openapi-doc
May 27, 2026
Merged

vincbeck merged 3 commits into
apache:mainfrom
ColtenOuO:fix-get-pools-incorrect-404-openapi-doc

Conversation

@ColtenOuO

Copy link
Copy Markdown
Contributor

The GET /pools list endpoint had HTTP_404_NOT_FOUND in its OpenAPI responses decorator, but the endpoint can never return 404 — it always returns a collection (possibly empty).

This makes the OpenAPI spec accurately reflect the endpoint's actual behaviour and avoids misleading auto-generated SDK clients into handling a 404 that will never occur.

@ColtenOuO

Copy link
Copy Markdown
Contributor Author

Static checks failed on "Compile / format / lint UI" — this touches only React/TypeScript UI files that this PR doesn't modify.

@vincbeck

Copy link
Copy Markdown
Contributor

Static checks failed on "Compile / format / lint UI" — this touches only React/TypeScript UI files that this PR doesn't modify.

Still, some front-end artifacts are generated from openapi specs, please run prek to fix the static check failures

@ColtenOuO

Copy link
Copy Markdown
Contributor Author

Static checks failed on "Compile / format / lint UI" — this touches only React/TypeScript UI files that this PR doesn't modify.

Still, some front-end artifacts are generated from openapi specs, please run prek to fix the static check failures

Thanks! I use prek to fix the CI failures

@vincbeck
vincbeck merged commit 5b12684 into apache:main May 27, 2026
143 checks passed
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.0 milestone Jun 15, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Jun 15, 2026
pierrejeambrun pushed a commit that referenced this pull request Sep 30, 2026
…71647)

* Keep OpenAPI error responses in sync with the statuses routes raise

`create_openapi_http_exception_doc(...)` feeds the `responses=` block that the
generated spec — and every client built from it — uses to model error
responses, but nothing ties that list to the statuses a handler actually
raises. The two drift apart silently, and the same drift has had to be found
and patched by hand four times (#67570, #67571, #70992, #71011).

A static check keeps them together, so the next divergence fails in CI instead
of shipping a spec that omits a response the API really returns.

* Recognize Cadwyn routers in the OpenAPI error-response check

ROUTER_CLASSES omitted VersionedAPIRouter, so router-level `responses=` was invisible on every Cadwyn-based execution API route, and three statuses those routers already declare were reported as undeclared.

prek executes hook scripts directly, so the script needs its executable bit to run at all.
pierrejeambrun added a commit that referenced this pull request Oct 1, 2026
…71647) (#73968)

* Keep OpenAPI error responses in sync with the statuses routes raise

`create_openapi_http_exception_doc(...)` feeds the `responses=` block that the
generated spec — and every client built from it — uses to model error
responses, but nothing ties that list to the statuses a handler actually
raises. The two drift apart silently, and the same drift has had to be found
and patched by hand four times (#67570, #67571, #70992, #71011).

A static check keeps them together, so the next divergence fails in CI instead
of shipping a spec that omits a response the API really returns.

* Recognize Cadwyn routers in the OpenAPI error-response check

ROUTER_CLASSES omitted VersionedAPIRouter, so router-level `responses=` was invisible on every Cadwyn-based execution API route, and three statuses those routers already declare were reported as undeclared.

prek executes hook scripts directly, so the script needs its executable bit to run at all.

(cherry picked from commit 8d4ab8a)

Co-authored-by: Pushkal Gupta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants