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

Parse page properties refactor #128

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

Conversation

djs-CS
Copy link

@djs-CS djs-CS commented Mar 21, 2023

Excellent repo! It's been a great reference as I'm learning about building API clients and unmarshaling JSONs in Go. Hope this small change can improve the repo. Any feedback on my proposal would be greatly appreciated.

Dylan Sumser added 2 commits March 21, 2023 11:45
… byte slice parameter that gets passed in from Properties.UnmarshalJSON
Copy link
Owner

@jomei jomei left a comment

Choose a reason for hiding this comment

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

Hi, @djs-CS! Thanks for the proposal!

Could you please explain the point of these changes? I see that instead of parsing into interface{}, you propose to unmarshal into rawMessage and then unmarshal once again to interface{}. I don't really understand why your approach is better.

@djs-CS
Copy link
Author

djs-CS commented Apr 17, 2023

@jomei - thank you for the consideration and patience! I'm still new to Go and contributing to Open Source generally, so apologies for being unclear with my previous PR.

Passing rawMessage into parsePageProperties removes the necessity of re-marshaling an interface{} into a JSON only for it to be parsed back into the correct pageProperty. Would love to hear your thoughts! :)

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