1.0.0 • Published 10 months ago

json-api-reader v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

JsonApiReader

This is a small package to simplify reading records from APIs that implement the json:api v1.x format.

See the documentation site for more details.

The primary goal is to unpack response data and produce an output that is easier to navigate.

A complicated (but very efficient) JSON:API response could be converted to something like this:

// An sample article record with relationships.
{
	"id": 123,
	"title": "Some article title",
	"body": "Some long body text",
	"author": {
		"id": 99,
		"firstName": "Clark",
		"lastName": "Kent"
	},
	"comments": [
		{
			"id": 10,
			"content": "First!",
			"author": {
				"id": 100,
				"firstName": "Bruce",
				"lastName": "Wayne"
			}
		}
	]
}

Hope it helps.

1.0.0

10 months ago