On choosing a hypermedia type for your API - HAL, JSON-LD, Collection+JSON, SIREN, Oh My ! - Kevin Sookocheff
▻https://sookocheff.com/post/api/on-choosing-a-hypermedia-format
Un article qui compare 4 manières de structurer une API en JSON : JSON-LD, HAL, JSON:API, Collection+JSNO. Mais c’était en 2014. Depuis il me semble que JSON-LD est devenu plus important que JSON:API, niveau « leading format ».
To solve these problems we can look at how we structure our API responses. By using hypermedia in our responses we can offer links between API endpoints and documentation, potential actions, and related endpoints. This allows for discoverable APIs where it is clear from the API response the set of next actions that a client may want to take. Furthermore, by standardizing on a hypermedia type clients developed for one API can understand the format of another API and communicate with minimal duplicated effort.
In this post I will evaluate a few mature hypermedia types for APIs, offering a side-by-side comparison of their strengths and weaknesses. If you are impatient for the final result you can jump straight to the code.
#API #JSON #développement #web #hypermedia