
Discover how to build high quality API first applications with Spring Boot, focusing on well-documented, product-ready APIs powered by OpenAPI and strong tooling.
Learn best practices for api first development with Spring Boot, drawing on real-world experience as api producer and consumer, and the paramount role of an open api specification.
Block out a dedicated hour, complete the course with hands-on practice, finish quizzes and assignments, join the Slack community, and enroll to receive the Spring Framework Guru newsletter.
Configure a java-enabled development environment across macos, windows, or linux with 8–16 gb memory, java 17+, spring framework six and spring boot, and maven 3.6+, plus an apple-chip optimized jdk.
Compare free and paid IDEs for enterprise Java, highlighting IntelliJ community edition, the paid ultimate, and the value of reliable support that saves development time.
Master the GitHub workflow for this course by forking the repository, cloning to your local workspace, and using master and ending branches to compare changes.
This introduction defines what API first means, explains APIs as products within organizations, highlights open API specification as the core foundation, and previews API design through domain driven design.
Define API first as a product-centric approach that treats APIs as modular contracts and interoperable components, clarifying design versus development and the role of open API tools.
API first for organizations treats the API as the company's product, demanding product-grade quality, organizational alignment across marketing, product, and engineering, and well-documented, interoperable APIs.
Learn API-first best practices by treating the OpenAPI specification as the contract and single source of truth, validating, linting, and generating code to ensure governance and alignment.
Learn how api first companies treat apis as products, delivering high quality open api documentation and specifications, and evolve a first spec with domain driven design and robust data models.
Explore OpenAPI, a JSON or YAML RESTful API specification that uses a schema for code generation and documentation, and learn how Redocly hosts, version-controls, and lints OpenAPI docs.
Set up a GitHub repository from the read-only OpenAPI starter to host your API documentation, configure openapi.yaml, and organize the OpenAPI schema in modular, reusable files.
Review a dependabot version bump in the CLI from beta to 1.30, examine the merged PR and updated package.json, and ensure the starter template and JSON script environment stay current.
Create a development branch in GitHub, set it as the default, and tie the open API specification and documentation to this baseline for an API-first Spring Boot project.
Register an API first repository in Redocly for the development branch, link GitHub, and customize the OpenAPI spec for a Spring Boot project, including ci/cd workflow considerations.
Update and customize the API documentation by cleaning the template, creating a cleanup branch, editing metadata, pruning unused components, and validating with docker lint before pushing for a preview build.
Explore how OpenAPI specification readability elevates your API as a first-class citizen with tests and hosted documentation. Dive into domain driven design and use schema attributes to guide code generation.
Explore restful api design by contrasting soap with rest, emphasizing resource orientation, http methods, statelessness, and caching advantages while avoiding remote procedure call pitfalls.
Explore domain driven design and the ubiquitous language that aligns business concepts with software models. See how bounded contexts and context mapping enable clean boundaries and coherent APIs.
Define a web store domain using domain driven design with customer, product, and order subdomains, then implement via API first development guided by an open API specification.
Add the list customers operation using an OpenAPI schema, structure paths for V1, and stub a customer object to return a list of customers, with intellisense and basic auth security.
Complete the customer schema by adding a string id, a name object referencing name.yaml, ship to and bill to addresses, email, and a payment methods array with an id.
Add a get customer by id operation under v1/customers with a path parameter customerId, define 200, 400, and 404 responses, and validate the OpenAPI via lint to ensure API standards.
Add get endpoints for orders, including list orders and get order by ID, and normalize the OpenAPI spec by removing legacy user fields and adopting snake/camel case.
The lecture designs an order schema using domain driven design and an anti-corruption layer to isolate order data from customer and product subdomains, including order lines and shipment details.
Explore domain driven design for building a resource driven RESTful API, define rich open API schema attributes and constraints, and generate Java objects for a Spring Boot project.
Add min and max schema constraints for customer fields, including email, phone, address, name, and zip, and implement two-character state codes to enable bean validation and clearer api documentation.
Add required properties for the customer in OpenAPI, including name, first name, last name, and address fields, and test validation to clearly communicate what API consumers must provide.
Add realistic default values to the customer API documentation, including strings and an ISO date format, so API consumers see expected payloads.
Define a create customer endpoint by posting to /customers and returning a 201 with a location header, while marking the customer id as read-only and system managed.
Explain how to document nullable properties in OpenAPI 3.1, using two syntax options (list type and string or null) and update required and read only fields.
Refactor date created and date updated into a common ISO timestamp component to ensure consistency and enable a single place to update across the API.
Use the open api schema and code generator to produce Java pojos for a Spring Boot app, enabling bean validation and consistent quality from a single source of truth.
Explore hexagonal architecture, ports and adapters, that isolates business logic at the center, enables technology-agnostic interactions via adapters, and supports API-first tests with flexible persistence and messaging.
Create a new Maven project in IntelliJ for a Spring Boot workflow, establishing a multi-module build with an open API specification source generation module and a Spring Boot module.
Add a Maven API module and configure the OpenAPI Generator plugin to generate POJO models from an OpenAPI specification using the Java generator, with step-by-step IntelliJ setup.
Troubleshoot illegal argument exceptions when deserializing OpenAPI YAML by adjusting Redocly security settings to allow public access, then generate Java POJOs with the OpenAPI code generator for Maven.
Configure the open api code generation plugin to use Jackson, select rest template, and disable docs and tests to generate only pojo models.
Add missing maven dependencies, including OpenAPI tools Jackson data bind nullable, Java X annotation API, and Google Findbugs JSR 305, to enable clean compilation and generated pojo sources.
Enable bean validation by configuring the plugin and using hibernate validator 8.0 with the Jakarta namespace, then add Jakarta annotations for open api constraints used by spring boot.
Explore how to disable json nullable in the OpenAPI generator to stop wrapping nullable properties with jackson data bind nullable wrapper, by setting open API nullable to false, improving models.
Learn how to integrate Project Lombok to enable the builder pattern and an all-args constructor, by adding the dependency and configuring additional model type annotations for your Java models.
Refactor the open API to use integer dimensions, align generated code with this change, and push updates through a git workflow from commit to pull request into the development branch.
Explore open API code generation that creates client and server stubs for any language, then integrate generated code with Spring Boot and test using mock MVC.
Create a spring boot module in a multi-module maven project with IntelliJ and start.spring.io to generate an api first server, including validation, Lombok, and web starter.
Move the api server module to the root pom, inherit from the spring boot starter, and configure maven properties to enable api first dependencies and consistent build order.
Create a customer repository using Spring Data Commons and a CrudRepository interface, with a mock persistence layer to serve API data.
Initialize customer data by seeding an in-memory hash map repository with a builder-pattern customer and address objects, simulating a spring data persistence layer during bootstrap.
Create a robust list customers endpoint with a Spring Boot rest controller, a service interface, and a repository, following hexagonal architecture to return a mapped customer list via Postman.
Implement a get by id endpoint with a path variable, fetch the customer from the repository by id, throw a runtime exception on missing, and return a response entity.
Improve api functionality with a spring boot project using spring mockmvc and a request filter to validate operations and payloads against the openapi specification, the single source of truth.
Implement a base test for the customer controller with autowired repositories and Spring mvc, and verify a 200 ok response with a non-empty customers array.
Initialize a test customer in setup method to provide a valid id for get by id test, and perform a mock mvc get against customer URL to exercise controller method.
Add the swagger request validator dependency with version properties to your Maven project, exclude commons logging to avoid logback conflicts, and configure via a global mock mvc interceptor.
Configure a swagger request validator for tests with mock MVC, wiring a Jakarta filter and OpenAPI validation interceptor, then revert OpenAPI 3.1 to a previous version.
Test endpoints with spring mock mvc and validate against the open api schema using the Atlassian swagger validator. Ensure create operations align with the api-first open api specification.
implement the create product endpoint using tdd, wire a post /v1/product test with a jackson payload, and persist the new product via the product service and repository.
Implement a create order operation in the open api using an order create object that references product ID and quantity, with an anti-corruption layer between order and product data.
Implement a create order api by wiring an order create object with customer and product lookups, enforcing 201 responses per open api specification, and validating with the swagger request validator.
Fix failing order tests by updating the order builder to populate bill-to and ship-to addresses, phone, and a status; adjust the API spec to allow nullable fields for OpenAPI validation.
Clean up the open api schema by correcting tag names, fixing the selected payment method id, and correcting misspellings in dimensions and product properties, with code updates and GitHub commits.
Explore object-relational mapping with Hibernate, Spring Data JPA, and Java Persistence API to persist entities in a database and map the API domain to the persistence layer.
Explore object relational mapping fundamentals with ORM, JPA standards, and Hibernate, learning how objects map to tables, manage relationships (1-1, 1-many, many-to-many), and apply cascade controls for productive Java development.
Refactor domain objects to use dto naming suffix, adjust openapi model names, and refactor repositories, services, and data loader to work with dtos while preparing for JPA entities.
Update maven dependencies to include Spring Boot starter data JPA and H2 database, relying on versions inherited from the Spring Boot parent pom, then refresh and monitor vulnerabilities.
Create the customer entity in a domain package, annotate it as a JPA entity, and configure a Hibernate UID key stored as a string, using Lombok for getters.
Learn to model embedded name data in a customer with JPA by creating a name value object, annotating it as embedded, and persisting four name columns in the customer table.
Establish a one to one relationship between ship to address and bill to address using JPA, with addresses stored in separate tables and Lombok-generated accessors.
Create a bidirectional one-to-many relationship between payment methods and customers by adding a payment method entity and mapping it with one-to-many and many-to-one associations.
Enable audit timestamps with Hibernate to automatically populate date created and date updated using the VM time. Apply these timestamps to the customer, address, and payment method entities.
Implement a category entity and map a bidirectional many-to-many relationship with product, using default Hibernate mapping and a join table that stores both entity IDs.
Implement the order entity with unidirectional customer relation, ship info, date created, and order lines, add an order status enum, auditing timestamps, and Lombok builder defaults.
Take a comprehensive dive into the world of API First development using Spring 6 and Spring Boot 3. This extensive course covers the latest practices and tools for designing, building, and testing robust APIs following industry best practices.
You'll begin by understanding the foundational concepts of API-first development and its benefits for organizations. The course then guides you through the practical implementation of an API using OpenAPI specifications, domain-driven design principles, and code generation from OpenAPI specifications.
Throughout the course, you'll explore a wide range of topics, including:
Defining APIs using the OpenAPI specification and tools like Redocly
Using Redocly to establish CI/CD builds for your OpenAPI Specification and Redoc API Documentation
Applying domain-driven design principles for effective API design
Generating code from OpenAPI specifications using Maven with OpenAPI Code Generator
Developing Spring Boot and SpringMVC to implementing API endpoints
Testing APIs with Spring MockMVC and incorporate request validation to your OpenAPI Specification
Implementing create, update, patch, and delete operations for APIs
Object-relational mapping with JPA, Hibernate
Using MapStruct for efficient object mapping and type transformation
Enforcing data validation and constraints with JPA and Java Bean Validation
Handling standardized problems and errors with libraries like Zalando Problem
Generation of Spring Boot API clients and using clients with integration testing
Throughout the course, you'll work on a real-world e-commerce API project, applying the concepts and best practices learned in each section. By the end of this course, you'll have a deep understanding of API-first development using Spring 6 and Spring Boot 3 with OpenAPI, enabling you to design, build, and test robust APIs that adhere to industry standards.
This course is a master course in developing high quality world class API products for your customers.
Enroll now and elevate your skills in API development with Spring!