Skip to content

Context unable to bind twice #976

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

Closed
1 task done
mcquackers opened this issue Jul 25, 2017 · 2 comments
Closed
1 task done

Context unable to bind twice #976

mcquackers opened this issue Jul 25, 2017 · 2 comments

Comments

@mcquackers
Copy link

Issue Description

Using c.Bind(&exampleStruct) properly binds the incoming data to the struct, but then subsequently calling c.Bind(&differentExampleStruct) silently fails to bind.

Reversing the order of the bindings produces the same issue with respect to the bindings (&differentExampleStruct is the populated, but &exampleStruct is left empty)

Checklist

  • [X ] Dependencies installed
  • [ X] No typos
  • Searched existing issues and docs

Expected behaviour

All structs are populated with respective data from the request

Actual behaviour

Only the first struct is populated with data from the request

Steps to reproduce

Have an incoming request with JSON data that is a superset of the fields of two (or more) structs

Attempt to bind the incoming echo.Context to each struct.

See that only the first struct gets properly bound

@mcquackers
Copy link
Author

I are dumb

@vishr
Copy link
Member

vishr commented Jul 25, 2017

@mcquackers You can look into this comment #782 (comment)

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

No branches or pull requests

2 participants