openapi-contract-first

Author OpenAPI specs and validate diffs against a baseline.

50|7|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill openapi-contract-first
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi-contract-first
Source: https://github.com/loiane/specs-driven-development-spring-angular/tree/main/.windsurf/skills/openapi-contract-first
Command: npx skills add https://github.com/loiane/specs-driven-development-spring-angular --skill openapi-contract-first

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Resolve API contract drift by authoring OpenAPI specs and validating changes against a diff baseline.

Core Features & Use Cases

  • Author or update OpenAPI specs and validate changes against a baseline.
  • Generate DTOs and interfaces from the OpenAPI spec.
  • Scaffold and wire controllers for new or changed endpoints.
  • ADRs and diff-based gating for breaking changes.

Quick Start

Edit your OpenAPI spec under src/main/resources/openapi/openapi.yaml, then run the OpenAPI diff gate to regenerate DTOs and implement the controller.

Frequently Asked Questions about openapi-contract-first

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

FAQPage Schema
How do I prevent OpenAPI contract drift when updating Spring Boot APIs?

Resolve OpenAPI contract drift by authoring specs in openapi.yaml and validating changes against a diff baseline. This approach enforces ADRs for breaking changes and ensures non-breaking deployments before generating DTOs or wiring controllers.

What is the contract-first approach for generating Spring Boot DTOs?

The contract-first approach involves editing your OpenAPI specification first, then using openapi-generator to automatically generate DTOs and interfaces. This ensures your Spring Boot controllers and data models stay synchronized with the API contract.

How do I validate OpenAPI changes against a baseline diff?

Validate OpenAPI changes by running a diff gate against a baseline specification. This diff-based gating mechanism detects breaking changes, enforces architectural decision records, and prevents non-compliant API modifications from being deployed.

Can I scaffold Spring Boot controllers directly from an OpenAPI spec?

Yes, you can scaffold and wire Spring Boot controllers for new or changed endpoints directly from the OpenAPI spec. After editing openapi.yaml, generate DTOs with openapi-generator and implement the controller interfaces to match the contract.

Does openapi-generator work with springdoc for API validation?

Yes, openapi-generator works alongside springdoc to validate OpenAPI contracts in Spring Boot. While openapi-generator creates DTOs and interfaces from the spec, springdoc and baseline diffs ensure the implementation matches the authored openapi.yaml file.

When should I enforce ADRs for breaking API changes?

Enforce ADRs for breaking API changes whenever you modify endpoints in openapi.yaml. The diff-based gating process identifies breaking changes during validation, requiring architectural decision records to approve and document any non-backward-compatible API modifications.