HAL-HYPERTEXT
Convention links JSON HATEOAS Kelly.
Définition
HAL JSON content-type application/hal+json. Format : {_links: {self: {href:''}, next: {href:''}, related: [{href:''}]}, _embedded: {orders: [...]}, otherFields: ...}. Less formal qu'OData ou JSON:API, mais plus simple. Adopté par Spring HATEOAS, Foxycart, Amazon AppStream. Successeur HAL+JSON pour XML, mais HAL+XML moins usité.
Origine
HAL Internet-Draft IETF publie 2011 par Mike Kelly ; statut Informational depuis.
Exemple en contexte
Une API Spring HATEOAS retourne _links:{self:{href:'/orders/42'},customer:{href:'/customers/7'}} ; le client peut naviguer follow links.
Termes liés
- JSON:API — autre approche JSON.