[3.0.x] Fix reverse router for OptionalInt/Long/Double query params by arimu1 · Pull Request #14252 · playframework/playframework · GitHub
Skip to content

[3.0.x] Fix reverse router for OptionalInt/Long/Double query params - #14252

Merged
mkurz merged 1 commit into
playframework:3.0.xfrom
arimu1:fix/14244-optional-unbind-3.0.x
Sep 30, 2026
Merged

mkurz merged 1 commit into
playframework:3.0.xfrom
arimu1:fix/14244-optional-unbind-3.0.x

Conversation

@arimu1

@arimu1 arimu1 commented Sep 12, 2026 •

Copy link
Copy Markdown

Pull Request Checklist

  • Have you read How to write the perfect pull request?
  • Have you read through the contributor guidelines?
  • Have you referenced any issues you're fixing using commit message keywords?
  • Have you added copyright headers to new files? (N/A — no new files)
  • Have you checked that both Scala and Java APIs are updated?
  • Have you updated the documentation for both Scala and Java sections? (N/A — bugfix only)
  • Have you added tests for any changed functionality?

Fixes

Fixes #14244

Purpose

Backport of #12995 to the 3.0.x branch. QueryStringBindable for java.util.OptionalInt, OptionalLong, and OptionalDouble used value.toScala.getOrElse(0).toString in unbind, which dropped the query parameter name and produced invalid reversed URLs (e.g. ?111 instead of ?key=111).

The fix delegates unbind to the existing boxed Integer / Long / Double binders when a value is present, matching Optional[T] behavior.

Background Context

This is a straight backport of the merged main-line fix; no API or behavioral changes beyond correcting reverse routing for these Java optional primitive types.

References

Test plan

Backport of playframework#12995: use boxed Integer/Long/Double QueryStringBindable
unbind so reversed URLs include the parameter key.

Fixes playframework#14244
@PromanSEW

Copy link
Copy Markdown
Contributor

@mkurz
mkurz merged commit 316f494 into playframework:3.0.x Sep 30, 2026
26 checks passed
@mkurz

mkurz commented Sep 30, 2026

Copy link
Copy Markdown
Member

@Mergifyio backport 2.9.x

@mergify

mergify Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

mkurz added a commit that referenced this pull request Sep 30, 2026
[2.9.x] Fix reverse router for OptionalInt/Long/Double query params (backport #14252) by @arimu1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants