hateoas

Embed hypermedia links in REST responses using Spring HATEOAS.

203|35|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/rrezartprebreza/spring-boot-skills --skill hateoas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hateoas
Source: https://github.com/rrezartprebreza/spring-boot-skills/tree/main/skills/hateoas
Command: npx skills add https://github.com/rrezartprebreza/spring-boot-skills --skill hateoas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables building REST APIs that are navigable and self-describing by embedding hypermedia links using Spring HATEOAS, reducing client-side guesswork and proliferation of custom endpoints.

Core Features & Use Cases

  • Self links: always expose a link to the resource itself.
  • Collection links: provide navigation back to resource collections.
  • Action links: attach state-transition relations (e.g., cancel, ship) when valid for the current state.
  • RepresentationModelAssembler: use type-safe DTO builders to compose models with links.
  • PagedModel support: generate pagination links for pageable endpoints.

Quick Start

Implement a RepresentationModel-based DTO, wire a controller to return it with links built via linkTo(methodOn(...)), and then expose a paged collection if needed.

Frequently Asked Questions about hateoas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build self-describing REST APIs with Spring HATEOAS?

Build self-describing REST APIs by embedding hypermedia links in responses using RepresentationModel, EntityModel, and CollectionModel. This approach reduces client-side guesswork by exposing navigable resources and conditional state-transition actions directly within Spring Boot service responses.

What is the best way to add hypermedia links to REST API responses in Spring Boot?

Add hypermedia links by implementing RepresentationModel-based DTOs and wiring controllers to return them. Construct type-safe links using the linkTo and methodOn methods, ensuring clients can navigate resources and discover valid actions dynamically without hardcoded endpoints.

How do I use RepresentationModelAssembler to assemble hypermedia models?

Use RepresentationModelAssembler as a type-safe DTO builder to compose models with links. It converts domain entities into RepresentationModel objects, encapsulating the logic required to attach self links, collection links, and state-transition action links consistently.

Can I generate pagination links for pageable Spring Boot endpoints?

Generate pagination links for pageable endpoints using PagedModel support. This feature automatically creates navigation links for collections, allowing clients to traverse pages of resources without manually constructing pagination query parameters.

Does this approach support conditional action links for resource state transitions?

Conditional action links are supported for resource state transitions. You can attach relation links such as cancel or ship to resources only when they are valid for the current state, preventing clients from attempting invalid operations.

When should I use hypermedia links instead of standard REST responses?

Use hypermedia links when REST responses need to be navigable and self-describing. This reduces the proliferation of custom endpoints and minimizes client-side guesswork by dynamically exposing actions and related resource links based on the current application state.