Skip to content

JSON API#5

Open
msp wants to merge 8 commits into
masterfrom
msp-json-api
Open

JSON API#5
msp wants to merge 8 commits into
masterfrom
msp-json-api

Conversation

@msp
Copy link
Copy Markdown
Member

@msp msp commented Sep 26, 2017

Explore decoding JSON API

@msp
Copy link
Copy Markdown
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