Skip to content

1.0.0-RC2

Pre-release
Pre-release
Compare
Choose a tag to compare
@dakota dakota released this 18 Aug 13:36
· 16 commits to cake-4.x since this release

This release adds support for /relationships/ endpoints as defined by the JSON:API specification (fetching relationships and updating relationships). It also adds support for related (i.e. /countries/1/currency) endpoints. A helper JsonApiRoutes class was also added to automatically create JSON:API compliant routes.

In order to make use of the new relationships endpoints, you need to add the CrudJsonApi.Relationships CRUD action. In order to get full support for related endpoints, you need to make use of the CrudJsonApi.View action, instead of the default Crud.View one.

Breaking changes

  • Whitelist and blacklist for includes have been renamed as allowList and denyList.
  • Default inflection has been changed to variable (Generating camelBacked attribute and relationship names)
  • jsonApiBelongsToLinks config option has been removed.
  • All relationships will now be listed in the response, however only those with data loaded will have the data member populated, otherwise only links (where valid routes exist) will be populated.
  • The self link for relationships will always be a /relationships/ route (Where such a route exists)
  • The related link for relationships will be in the form of /{model}/{id}/{relationshipName} where such routes exist, otherwise it will be a direct link to the related entity view (if such a route exists)