Kunal8954 opened a new pull request, #72470:
URL: https://github.com/apache/airflow/pull/72470
## What
Changes the `Accept` header's OpenAPI schema on four endpoints from an
`enum` to `examples` list, and regenerates the OpenAPI spec accordingly.
## Why
The affected endpoints (`/dagSources/{dag_id}`, `/config`,
`/config/section/{section}/option/{option}`, and the task instance logs
endpoint) declare an `Accept` header with `json_schema_extra` listing
`application/json`, `text/plain` and `*/*` as an `enum`.
Some OpenAPI client generators - notably the Java generator - render
each `enum` value as its own named constant, with a Javadoc comment
built from that literal value. `*/*` contains `*/`, which prematurely
closes the generated Javadoc comment block, producing invalid Java
that fails to compile.
`enum` was also semantically wrong here: a real `Accept` header isn't
restricted to these exact literals (it can carry q-values, be
comma-separated, etc.), so `examples` is the more accurate keyword
regardless of the codegen bug.
## Changes
- `airflow-core/src/airflow/api_fastapi/common/headers.py`: `enum` →
`examples` for both `header_accept_json_or_text_depends` and
`header_accept_json_or_ndjson_depends`, plus a `description` and an
explanatory comment.
-
`airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml`:
regenerated via `prek run generate-openapi-spec`.
- Added a newsfragment.
Fixes #72466
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]