Readplace

kevinswiber/siren: Structured Interface for Representing Entities, super-rad hypermedia

GitHub 6 min read
View original
Summary (TL;DR)
Siren is a hypermedia specification for representing entities in web APIs, similar to HTML for websites but for API responses. It structures information about entities, actions for state transitions, and links for navigation. Key components include entity class, properties, sub-entities (embedded links or representations), links with rel and href, and actions with methods, href, and fields. Example given of an order entity with sub-entities for items and customer, an action to add items, and navigational links. Distinctions made between classes vs. relationships and sub-entities vs. links. Supports task-based interfaces. Media type application/vnd.siren+json.