-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdoc.go
41 lines (41 loc) · 1.15 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Package jsonapi provides utilities for converting Go data to/from the JSON API format detailed at http://jsonapi.org.
//
// Consider an example, some structs representing a simple backend for a blog engine:
//
// type Person {
// ID int
// Name string
// Age int
// }
//
// type Article struct {
// ID int
// Title string
// Body string
// Created time.Time
// Updated time.Time
// Author *Person
// }
//
// The article data could be represented in a JSON format in compliance with the JSON API specification like so:
//
// {
// "id": "...",
// "type": "articles",
// "attributes": {
// "title": "...",
// "body": "...",
// "created": "...",
// "updated": "..."
// },
// "relationships": {
// "author": { ... }
// },
// "links": { ... },
// "meta": { ... }
// }
//
// In order to expose the article's data in the desired format, the some methods must be implemented to satisfy
// the expected interfaces for converting to/from resources. For a full list of supported interfaces as well as
// tested examples, please see the documentation for ToResource and FromResource.
package jsonapi // import "github.com/smotes/jsonapi"