jsonapi.org style payload serializer and deserializer. Forked to do more modern Go stuff
Go to file
Sam Woodard b112561a72 support unmarshal sideloaded records for two-way function 2015-07-10 11:41:54 -07:00
.gitignore licence and begin readme 2015-07-08 16:48:13 -07:00
LICENSE licence and begin readme 2015-07-08 16:48:13 -07:00
README.md licence and begin readme 2015-07-08 16:48:13 -07:00
node.go remove 'JsonApi' everywhere, since we're already in a pkg 2015-07-10 09:07:12 -07:00
request.go support unmarshal sideloaded records for two-way function 2015-07-10 11:41:54 -07:00
request_test.go support unmarshal sideloaded records for two-way function 2015-07-10 11:41:54 -07:00
response.go support unmarshal sideloaded records for two-way function 2015-07-10 11:41:54 -07:00
response_test.go remove 'JsonApi' everywhere, since we're already in a pkg 2015-07-10 09:07:12 -07:00

README.md

jsonapi

A serailizer/deserializer for json payloads that comply to the jsonapi.org spec in go.

Background

You are working in your Go web application and you have a struct that is similar to how your datbase table looks. You need to send and receive json payloads that adhere jsonapi spec. Once you realized that your json needed to take on this special form, you went down the path of creating more structs to be able to serialize and deserialize jsonapi payloads. Then more models required these additional structure. Ugh! In comes jsonapi. You can keep your model structs as is and use struct field tags to indicate to jsonapi how you want your response built or your request deserialzied. What about my relationships? jsonapi supports relationships out of the box and will even side load them in your response into an "included" array--that contains associated objects.