Skip to content

fix Bind() when target is slice and path/query params complain target not being struct. #1835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2021

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Apr 6, 2021

fix Bind() when target is slice and path/query params complain target not being struct.

For path/query params binding we do not try (silently return) to bind when target is not struct.
Recreates PR #1574 and fixes #1565

… not being struct.

For path/query params binding we do not try (silently return) to bind when target is not struct.
Recreates PR labstack#1574 and fixes labstack#1565
@aldas aldas requested a review from lammel April 6, 2021 05:05
@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #1835 (48507f9) into master (dec96f0) will decrease coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1835      +/-   ##
==========================================
- Coverage   89.49%   89.35%   -0.15%     
==========================================
  Files          32       32              
  Lines        2685     2687       +2     
==========================================
- Hits         2403     2401       -2     
- Misses        181      183       +2     
- Partials      101      103       +2     
Impacted Files Coverage Δ
bind.go 88.88% <100.00%> (-2.37%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dec96f0...48507f9. Read the comment docs.

Copy link
Contributor

@lammel lammel left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Ignoring the query param is required in such a case (handling an array not struct).
Although we could add a warning I feel it's better to leave it that way to avoid spurious warning in the logs.

@lammel lammel merged commit 67f6346 into labstack:master Apr 6, 2021
@lammel lammel added this to the v4.2.2 milestone Apr 6, 2021
@aldas aldas deleted the fix_slice_as_bind_target branch May 23, 2021 06:06
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.

Binding json array fails when there is any parm in url
2 participants