Crud Listener for (rapidly) building CakePHP APIs following the JSON API specification.
Documentation found here.
composer require friendsofcake/crud-json-api
- standardized API data fetching, data posting and (validation) errors
- automated handling of complex associations/relationships
- instant compatibility with JSON API supporting tools like Ember Data
- tons of configurable options to manipulate the generated json
{
"data": {
"type": "countries",
"id": "2",
"attributes": {
"code": "BE",
"name": "Belgium"
},
"relationships": {
"currency": {
"data": {
"type": "currencies",
"id": "1"
},
"links": {
"self": "/currencies/1"
}
},
"cultures": {
"data": [
{
"type": "cultures",
"id": "2"
},
{
"type": "cultures",
"id": "3"
}
],
"links": {
"self": "/cultures?country_id=2"
}
}
},
"links": {
"self": "/countries/2"
}
},
"included": [
{
"type": "currencies",
"id": "1",
"attributes": {
"code": "EUR",
"name": "Euro"
},
"links": {
"self": "/currencies/1"
}
},
{
"type": "cultures",
"id": "2",
"attributes": {
"code": "nl-BE",
"name": "Dutch (Belgium)"
},
"links": {
"self": "/cultures/2"
}
},
{
"type": "cultures",
"id": "3",
"attributes": {
"code": "fr-BE",
"name": "French (Belgium)"
},
"links": {
"self": "/cultures/3"
}
}
]
}
Before submitting a PR make sure:
- PHPUnit and CakePHP Code Sniffer tests pass
- Codecov Code Coverage does not drop