Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (33 loc) · 1.06 KB

9-hateoas.md

File metadata and controls

41 lines (33 loc) · 1.06 KB

9 - Hateoas

HATEOAS stands for Hypermedia as the Engine of Application State, and adds hypermedia links to your representations (i.e. your API responses). HATEOAS is about the discoverability of actions on a resource. This is a requirement for building a REST API.

The Hateoas PHP library leverages the (JMS) Serializer library to provide a nice way to build HATEOAS REST web services.

Task: Transform the allAction() response in a HAL compliant response:

{
    "_embedded": {
        "users": [
            ...
        ]
    },
    "_links": {
        ...
    },
    "limit": 10,
    "page": 1,
    "pages": 7,
    "total": 66
}

Tip: Hateoas has built-in support for Pagerfanta.

Task: Write scenarios to cover this new feature.


Previous | Back to the index  | Next