Fix OpenAPI 3 path coercion to respect coerce_path_params independently of query coercion#467
Merged
Fix OpenAPI 3 path coercion to respect coerce_path_params independently of query coercion#467
Conversation
…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.
14c9d92 to
9574264
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes OpenAPI 3 request coercion behavior where path parameter coercion was unintentionally coupled to
coerce_query_params.OperationWrapper#coerce_path_parameterwas building its parser options usingcoerce_query_paramsinstead ofcoerce_path_params.As a result, this configuration behaved incorrectly.
coerce_path_params: truecoerce_query_params: falsePath coercion could be disabled even when explicitly enabled.