Skip to content

Percent-encode API client path params#68667

Merged
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:encode-ui-api-path-params
Jun 17, 2026
Merged

Percent-encode API client path params#68667
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:encode-ui-api-path-params

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Variable keys may start with or contain / (e.g. /foo). The generated UI API client interpolated path params with encodeURI, which intentionally leaves / unescaped — so a key /foo produced a literal // in the URL (/api/v2/variables//foo). Some proxies collapse ///, silently dropping the slash and corrupting the key, so GET/PATCH/DELETE of such variables fail behind those proxies (create is unaffected, since the key travels in the request body).

Switching OpenAPI.ENCODE_PATH to encodeURIComponent escapes / as %2F, so no literal // ever appears; the backend decodes it back to /. It's a no-op for plain keys, and also correctly escapes other characters (?, #, &, …) that encodeURI wrongly left untouched in path-param values.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jun 17, 2026
@pierrejeambrun

Copy link
Copy Markdown
Member Author

Before

Screen.Recording.2026-06-17.at.11.42.07.mov

After

Screen.Recording.2026-06-17.at.11.39.54.mov

@guan404ming guan404ming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@pierrejeambrun pierrejeambrun changed the title Percent-encode API client path params for keys with slashes Percent-encode API client path params Jun 17, 2026
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.0 milestone Jun 17, 2026
@pierrejeambrun
pierrejeambrun merged commit 9140ce5 into apache:main Jun 17, 2026
85 checks passed
@pierrejeambrun
pierrejeambrun deleted the encode-ui-api-path-params branch June 17, 2026 11:54
@pierrejeambrun pierrejeambrun added the backport-to-v3-3-test Backport to v3-3-test label Jun 17, 2026
pierrejeambrun added a commit that referenced this pull request Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants