jsonapi.org style payload serializer and deserializer. Forked to do more modern Go stuff
Go to file
Sam Woodard 5fc25e655a in marshal methods, write json directly to io.Writer 2015-07-10 08:57:27 -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 test request relationships, nested relationships 2015-07-08 09:35:20 -07:00
request.go simplification, whitespace 2015-07-10 08:30:59 -07:00
request_test.go skip field if attr is not in the hash 2015-07-09 12:27:03 -07:00
response.go in marshal methods, write json directly to io.Writer 2015-07-10 08:57:27 -07:00
response_test.go in marshal methods, write json directly to io.Writer 2015-07-10 08:57:27 -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.