api/presenters/SwordPresenter
:
id
, name
, and strenght
keys.
Register different formats for different actions
If you want the resource to return different data, you can register unique formats and the attributes that format should return:id
attribute when making an API call to collections endpoint
/swords
to retrieve a list of sword resources.
Register custom formats
You may want to define a custom format that can return specific attributes when making an API call by including the_format
URL parameter. For example, you can present specific fields by
calling the GET /swords?_format=all_attributes
endpoint.
SwordPolicy
.