Releases: lode/jsonapi
v1.5.0: better link objects
This has some much needed improvements on how jsonapi handles link objects.
Mainly, it makes it way easier to follow the spec for adding links, see #10 for the structure change. Basically you can now:
- Use 
add_link('search', 'https://google.com')and get: 
{
	"links": {
		"search": "https://google.com"
	}
}- Or use 
add_link('search', 'https://google.com', $meta=['label'=>'Look it up'])and get: 
{
	"links": {
		"search": {
			"href": "https://google.com",
			"meta": {
				"label": "Look it up"
			}
		},
	}
}Before, you had to create this switch and structure manually.
You can still pass an array or object as second argument and skip the metadata to use your own structure for the link object.
Other changes
- a 
selflink can also have metadata by usingadd_self_link_meta()orset_self_link() - an error object's 
aboutlink can also contain metadata - links can be added to errors and collection documents (both now also have 
add_link()andfill_links() - custom links can be added to a resource document's root-level
 
v1.4.1: fix to-many relationships to follow the spec
A fix for to-many relationships to follow the spec.
v1.4.0: improve nesting and to-many relationships
A bunch of small but important improvements to relationships:
- Relationships now can also be of the to-many type, thanks @Pierozi! (#17, see example)
 - Nesting relationships; when adding a relationship which has a relationship on itself, the latter is also added to the included set of the parent (#27, see example)
 - Nesting meta-data; root-level meta of a resource is passed to a collection's root-level meta, and root-level meta of a relationship is passed to its parent (#28)
 
Another unrelated change:
- Allowing responses with only meta data and no primary data, thanks @tstrijdhorst! (#26)
 
v1.3.1: fixes exceptions
- exceptions threw an exception since jsonp support was added
 - exceptions out of direct control which used non-400/500 error codes couldn't be added to the errors collection
 
v1.3.0: adds jsonp support
This makes it possible to send the jsonapi response in a jsonp callback container.
Thanks @lthh89vt for adding this!
v1.2.1: fixes exception during exception handling
v1.2.0: improve http status handling and ease exception-to-jsonapi rendering
v1.1.2: fixes exceptions without file reference
Merge branch 'fix-undefined-trace-file'
v1.1.1: fixes meta objects on error responses
v1.1.0: better error handling
This release improves errors handling and processing a bit:
- error messages and exception meta data is automatically hidden on production environments, using 
display_errors(#6) - exception meta data has improved display in errors responses (#7)
 - content type is always send out as utf-8 (#13)
 - easy constants are available for error documents, i.e. using 
jsonapi\base::STATUS_METHOD_NOT_ALLOWEDinstead of 405 (https://github.com/lode/jsonapi/pull/12/files) 
Next up is an easy way to go from thrown exceptions directly to an error response. See #11.