Skip to content
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

Improve handleStruct to use struct's own Unmarshaler if it is available #169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michele
Copy link

@michele michele commented Mar 5, 2019

handleStruct wasn't properly handling structs with custom marshaler/unmarshaler.

With this PR handleStruct correctly handles structs which implement the json.Unmarshaler interface.

This should fix #164

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@michele
Copy link
Author

michele commented Mar 5, 2019

I signed it

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@mellena1
Copy link

Is there anything holding this back from getting merged? Worked for me with a custom struct holding a time.Time struct with a custom UnmarshalJSON method. I think this functionality is necessary for a lot of use cases.

@michele
Copy link
Author

michele commented May 11, 2019

@mellena1 we've been using it for the past couple of months in production and it's working fine. Who's got the power to merge this? You can use my fork in the meanwhile.

@mellena1
Copy link

@michele I started using your fork last night and it’s working great for me so far. Thanks a lot for the work! Hopefully this can be merged in soon.

The only other thing I think would be good to add to this PR would be some documentation in the README, but it definitely works intuitively without it.

@alexfrancavilla
Copy link

@shwoodard Hi, could you take a look at this or dispatch it to somebody else with access to this project?

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.

Are custom attribute types in the roadmap anymore?
4 participants