REST API Conventions for Spring Boot 4

    2

    Production-grade REST API design and review guidance for Spring Boot 4 without breaking existing contracts.

    Free

    3 installs5.0 (1 review)

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    REST API Conventions for Spring Boot 4

    Example session with this skill installed

    Add paginated create, get, and list endpoints for orders to this Spring Boot 4 service. Preserve its existing /api/v1 contract, validate requests, return RFC 9457 errors, and add controller tests.

    • Read your context and instructions
    • Compiled the rest api conventions

    API contract review

    The agent first inspects existing controllers, DTOs, exception handlers, OpenAPI definitions, security rules, and MockMvc tests. It treats existing response formats and route conventions as compatibility requirements rather than replacing them with a generic envelope.

    Endpoint design

    • POST /api/v1/orders validates a dedicated request DTO, delegates business rules to the service, returns 201 Created, and includes a Location header.
    • GET /api/v1/orders/{id} returns the established order response DTO and maps missing resources to 404.
    • GET /api/v1/orders accepts bounded page and size parameters, deterministic sorting, and the project's existing pagination response shape.
    • Domain entities remain inside the persistence layer and are never serialized directly.

    Error handling

    Validation failures, malformed requests, missing resources, conflicts, and unexpected failures are mapped through one controller advice using Spring's ProblemDetail support. Every error uses application/problem+json and includes stable machine-readable fields without exposing stack traces or implementation details. Successful responses keep their normal media type and are not wrapped in Problem Details.

    Tests delivered

    Focused MockMvc tests cover successful creation, Location headers, validation errors, not-found behavior, conflict mapping, pagination bounds, deterministic ordering, content types, and authorization behavior. Service behavior is mocked only at the controller boundary.

    Next steps

    Run the controller and contract tests, compare the generated OpenAPI document with the prior version, and verify that API consumers tolerate only the intentional additions.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Create and review Spring Boot REST controllers while preserving the project's established API contract. The skill covers DTO boundaries, response shapes, pagination, HTTP status mapping, API versioning, request validation, controller-service separation, and RFC 9457 Problem Details for errors. It includes controller examples and reusable response templates.

    Use it when adding endpoints, modernizing inconsistent controllers, reviewing generated code, or defining conventions for a Spring Boot 4 service. It begins by inspecting the repository's existing routes, payloads, exception handling, and tests so that changes remain compatible with real clients.

    Open source under the MIT License. GitHub is the primary source: https://github.com/rrezartprebreza/spring-boot-skills

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    5.0
    1 review
    5
    1
    4
    0
    3
    0
    2
    0
    1
    0

    3 people have installed this skill.

    Trust & safety

    Security scanned

    Verified clean 10 days ago

    • Free to download with an account

    Listed10 days ago

    What's inside

    Frequently Asked Questions