Skip to content

Fix OpenAPI 3 path coercion to respect coerce_path_params independently of query coercion#467

Merged
geemus merged 1 commit intomasterfrom
fix-path-coercion
Feb 13, 2026
Merged

Fix OpenAPI 3 path coercion to respect coerce_path_params independently of query coercion#467
geemus merged 1 commit intomasterfrom
fix-path-coercion

Conversation

@ydah
Copy link
Member

@ydah ydah commented Feb 9, 2026

This PR fixes OpenAPI 3 request coercion behavior where path parameter coercion was unintentionally coupled to coerce_query_params.

OperationWrapper#coerce_path_parameter was building its parser options using coerce_query_params instead of coerce_path_params.

As a result, this configuration behaved incorrectly.

  • coerce_path_params: true
  • coerce_query_params: false

Path coercion could be disabled even when explicitly enabled.

…ly of query coercion

This PR fixes OpenAPI 3 request coercion behavior where path parameter coercion was unintentionally coupled to `coerce_query_params`.

`OperationWrapper#coerce_path_parameter` was building its parser options using `coerce_query_params` instead of `coerce_path_params`.

As a result, this configuration behaved incorrectly.

- `coerce_path_params: true`
- `coerce_query_params: false`

Path coercion could be disabled even when explicitly enabled.

Additionally, this PR fixes a related validation gap: path params must still be validated even when `coerce_path_params` is `false`.
`coerce_path_params: false` now means:

- path params are validated
- path params are not coerced

and remains independent from `coerce_query_params`.

Tests were updated to cover both option combinations and to assert query coercion behavior using actual query params.
`bundle exec rake test` passes.
@ydah ydah force-pushed the fix-path-coercion branch from 14c9d92 to 9574264 Compare February 9, 2026 14:45
Copy link
Member

@geemus geemus left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@geemus geemus merged commit 479b757 into master Feb 13, 2026
8 checks passed
@geemus geemus deleted the fix-path-coercion branch February 13, 2026 02:40
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.

2 participants