REST API Conventions for Spring Boot 4

    by Rrezart Prebreza

    2

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

    Free

    5 uses5.0 (1 review)

    Works with the AI Agents you already use

    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

    Optimized for Spring Boot 4/Framework 7. Does not support legacy Hand-rolled RequestCondition versioning or Jackson 2 specific configurations.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

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

    This skill has been used 5 times.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    • Free with an Agensi account

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Creator

    Rrezart Prebreza

    Rrezart Prebreza

    3 skills on Agensi

    Senior software engineer with 10+ years of experience designing and building production-grade systems across fintech, banking, and enterprise software, collaborating with international remote teams in the US, Switzerland, and Germany. My core expertise is in backend engineering with Java, Spring Boot, and .NET, building scalable, secure, and maintainable systems for real business environments. I work extensively with Spring MVC, Spring Security, Spring Data JPA/Hibernate, REST APIs, RabbitMQ, Docker, Keycloak, and Duo integration, with strong experience in authentication, enterprise workflows, and service-based architectures. I also build AI-enabled backend solutions using Spring AI, LLM integrations, RAG pipelines, and prompt engineering, helping turn modern AI capabilities into practical business applications. My experience includes designing and integrating RESTful APIs, XML services, SDMX-based data exchange systems, and enterprise reporting solutions. I have worked with PostgreSQL, MySQL, Oracle, Microsoft SQL Server, and MariaDB, along with tools such as Liquibase for database versioning and deployment. On the frontend side, I have experience with Angular, React, Thymeleaf, JSP, HTML, CSS, JavaScript, and TypeScript, allowing me to contribute across full-stack projects when needed. In addition to industry work, I have over 6 years of teaching experience as a lecturer at Universum International College, where I teach Java, Spring Boot, Web Services, Data Structures, and Software Engineering. I am also certified in Digitally Enhanced, Blended, and Online Learning by Cintana Education and serve as an academic reviewer for the International Journal of Computing and Digital Systems. I enjoy building secure, scalable, and modern software solutions that combine strong engineering practices with practical innovation. Tech Stack: Java, Spring Boot, .NET, Spring AI, Spring Security, Spring Data JPA, Hibernate, REST APIs, RabbitMQ, Docker, Keycloak, Duo, PostgreSQL, MySQL, Oracle, SQL Server, MariaDB, Liquibase, JWT, Angular, React, Thymeleaf, JSP, JavaScript, TypeScript, Power BI, Jaspersoft, GitHub, Bitbucket, JIRA, CI/CD, Agile, Scrum

    Frequently Asked Questions

    This skill ensures that new endpoints or refactored code adhere to your existing project architecture, specifically managing DTO boundaries, HTTP status mapping, and RFC 9457 error handling to prevent breaking changes for existing clients.

    The skill is optimized for Spring Boot 4 environments and Java-based backend services; it is compatible with any major AI agent platform that supports custom instructions or skill integration for code generation.

    Upon acquisition, you receive the full integration logic, production-grade controller templates, and reusable response shapes designed to handle pagination and request validation out of the box.

    The skill performs an initial scan of your repository's routes, payloads, and exception handlers to align its recommendations with your service's established conventions and testing patterns.

    As an MIT-licensed open-source project hosted on GitHub, you can access the latest updates and version improvements directly through the repository to ensure your API conventions stay current with Spring Boot 4 evolutions.

    New in APIs & Backend

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Free