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

JSON API #5

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

JSON API #5

wants to merge 8 commits into from

Conversation

msp
Copy link
Member

@msp msp commented Sep 26, 2017

Explore decoding JSON API

@msp
Copy link
Member Author

msp commented Sep 30, 2017

Hey @guspower, @nurugger07 - I went for a split approach of creating intervening *Attribute types and using a factory to convert one to the other.

E.g. the decoders only care about the WidgetAttributes type for their expectations. Widget.factory takes this and the other nested types and returns the top level Widget.

Bit of duplication in the definition but the type safety/compiler should have our back at the application interface (Widget) and the decoder interface (WidgetAttributes).

To review, i'd look at WidgetDecoder & Widget. I followed the same pattern on the other types.

Thoughts welcome!

@msp msp force-pushed the master branch 2 times, most recently from abb399c to 9efa4d2 Compare October 23, 2017 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant