univedo/api2go — pull request #3 by lucas-clemente (2014-08-22 22:19:03+00:00)
Title: Unmarshaling

Problem: We don't know the key names for the root document, i.e. we can't simply pass a struct to go's json unmarshal.

I think our options are:
- Unmarshal into a `interface{}`, then manually copy stuff into the structs. Effectively means reimplementing go's unmarshaling.
- Unmarshal into a `interface{}`, then use lambdas (type name -> instance) to create and fill the structs.
- Have the user setup a struct for unmarshaling (sth like `struct {simple_posts: []interface SimplePost}`).
- Somehow "strip" the root document before unmarshaling.

What do you think?