spring-openapi

Generate Spring Boot server interfaces and DTOs from an OpenAPI YAML contract.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/dprice-dev/claude-java-skills --skill spring-openapi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-openapi
Source: https://github.com/dprice-dev/claude-java-skills/tree/main/.claude/skills/spring-openapi
Command: npx skills add https://github.com/dprice-dev/claude-java-skills --skill spring-openapi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates the mismatch and rework that happen when API contracts and backend implementations drift apart by making your OpenAPI YAML the source of truth for controllers and DTOs.

Core Features & Use Cases

  • OpenAPI-first contract workflow: Author paths, schemas, and operationIds in src/main/resources/openapi/api.yaml and use that spec to drive implementation.
  • Spec-driven code generation: Generate Spring Boot server interfaces and model types from the spec, then implement the generated interfaces in your own controllers.
  • Static SwaggerUI documentation: Serve Swagger UI from the static spec file so your documentation reflects the contract you wrote.
  • Use Case: You define endpoints like POST /orders and schema objects like CreateOrderRequest and OrderResponse, regenerate code, implement the generated *Api interface, and validate client/server expectations against the same contract.

Quick Start

Indent and edit your API contract in src/main/resources/openapi/api.yaml, then run compile to regenerate the interfaces and models and implement the generated *Api methods.

Frequently Asked Questions about spring-openapi

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

FAQPage Schema
How do I generate Spring Boot server interfaces from an OpenAPI YAML spec?

Spec-driven code generation converts your OpenAPI YAML contract into Spring Boot server interfaces and DTO types. You author the spec, run the generator during compile, and implement the generated *Api interfaces in your controllers without manual edits to the generated code.

What is OpenAPI-first development and how does it prevent API contract drift?

OpenAPI-first development makes your YAML contract the source of truth for controllers and DTOs. By generating server code from the spec, it eliminates the mismatch and rework that happens when backend implementations and API contracts drift apart during development.

Can I serve Swagger UI from a static OpenAPI spec file in Spring Boot 4?

Yes, you can configure Swagger UI to serve static OpenAPI spec documentation directly from your YAML file. This ensures your API documentation always reflects the exact contract you wrote in src/main/resources/openapi/api.yaml without manual synchronization.

Do I need to manually edit generated server interfaces when using OpenAPI Generator?

No, you should not manually edit generated server interfaces and model types. You implement the generated *Api interface methods in your own controller classes, leaving the generated contract code untouched so regeneration remains safe during spec updates.

What is the best way to structure a spec-driven workflow for Spring Boot APIs?

The best spec-driven workflow places your OpenAPI YAML in src/main/resources/openapi/, runs compilation to regenerate interfaces and models into build directories, and implements generated *Api methods in custom controllers to validate client and server expectations against one contract.

Does OpenAPI code generation work with Java 25 and Spring Boot 4?

Yes, this spec-driven code generation approach fits migration toward contract-governed development in Spring Boot 4 with Java 25. It generates server interfaces and model types from your OpenAPI spec that you implement directly in your Spring controllers.