openapi-to-application-java-spring-boot
Skill41k starsChanged 20 days agoMITView on GitHub
Generate a Spring Boot (Java) application from an OpenAPI 3 specification using the spec-first approach: openapi-generator (Maven or Gradle) produces API interfaces and DTOs, you implement controllers, services, persistence, security and tests. Use when asked to build, scaffold or implement a Spring Boot API from an OpenAPI/Swagger file.
Trending
More talk lately.about the whole repository
Who's talking about github/awesome-copilot
- Software Developer Diaries“What are Skills, Agents, Prompts, Instructions and how to use them?”YouTube · Mar 28, 2026 · 78k views
- James Montemagno“Manage Agents, Instructions, Prompts, & Skills in Seconds with this VS Code Extension”YouTube · Dec 20, 2025 · 33k views
- TechWhistle“10 GitHub Copilot Tricks Most Developers Don't Know (2026)”YouTube · Apr 1, 2026 · 31k views
- GitHub Daily Trend AI Podcast“GitHub - github/awesome-copilot: Community-contributed instructions, prompts, and configurations ...”YouTube · Oct 2, 2025 · 532 views
- Next Horizon“awesome-copilot: AI Coding Assistance with Community Agents & Plugins”YouTube · Oct 17, 2026 · 152 views
The biggest 5 of 86 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 86
Talked about on Bluesky, GitHub, YouTube, Hacker News and the web (86 times).
On Bluesky · 41
- Jul 2, 2025Less vibes, more standards. Custom instructions, prompts, and chat modes for Copilot → github.com/github/aweso... — @vscode.dev28 likes and reposts
- Aug 20, 2025I did an overhaul of the Awesome Copilot README to make it easier to install the prompts, instructions, and chat modes to VS Code - there… — @aaron-powell.com14 likes and reposts
- Jul 31, 2025Fixed a bug on github.com/github/aweso... so you can now one-click add Chat Modes to your VS Code environment (it worked for prompts and… — @aaron-powell.com5 likes and reposts
- Jul 1, 2025Community-contributed instructions, prompts, and configurations to help you make the most of GitHub Copilot. github.com/github/aweso... — @garrytrinder.dev5 likes and reposts
- Jul 3, 2025Want GitHub Copilot to follow the most modern best practices in your language of choice? Guide it with custom instructions, starting from… — @pamelafox.bsky.social4 likes and reposts
36 more on Bluesky
- Oct 1, 2026📦 github / awesome-copilot ⭐ 39,586 (+59) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social3 likes and reposts
- Mar 5, 2026It's honestly been a lot of a trial and error for me. I did do some training at work but applying it to real-world problems and picking the… — @adamrdriscoll.com3 likes and reposts
- Dec 11, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 13,991 (+111) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social3 likes and reposts
- Oct 23, 2025📦 github / awesome-copilot ⭐ 10,301 (+73) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social3 likes and reposts
- Sep 25, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 8,027 (+102) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- Jul 4, 2025👀 Check this :A community-powered repo to enhance your GitHub Copilot experience > shared prompts, instructions, and configs so Copilot… — @elbruno.com3 likes and reposts
- Sep 24, 2026📦 github / awesome-copilot ⭐ 39,304 (+43) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social2 likes and reposts
- Aug 26, 2026📦 github / awesome-copilot ⭐ 38,267 (+44) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social2 likes and reposts
- Mar 7, 2026github / awesome-copilot Community-contributed instructions, prompts, and configurations to help you make the most of GitHub Copilot.… — @pythonhub.dev2 likes and reposts
- Mar 1, 2026Community-curated collection of specialized agents, instructions, and workflows that transform GitHub Copilot from basic autocomplete into… — @arifsolmaz.bsky.social2 likes and reposts
- Feb 26, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 22,634 (+146) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social2 likes and reposts
- Jan 10, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 16,762 (+165) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending.bsky.social2 likes and reposts
- Dec 2, 2025📦 github / awesome-copilot ⭐ 13,317 (+77) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social2 likes and reposts
- Nov 19, 2025Awesome GitHub Copilot Customizations github.com/github/aweso... — @adamrdriscoll.com2 likes and reposts
- Nov 7, 2025📦 github / awesome-copilot ⭐ 11,436 (+79) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social2 likes and reposts
- Oct 9, 2025I've enrolled the Awesome Copilot repo for #Hacktoberfest, so if you want to join the challenge, you now can with github.com/github/aweso... — @aaron-powell.com2 likes and reposts
- Nov 3, 2026📦 github / awesome-copilot ⭐ 40,747 (+52) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Oct 28, 2026📦 github / awesome-copilot ⭐ 40,463 (+45) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Sep 11, 2026📦 github / awesome-copilot ⭐ 38,893 (+53) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social1 likes and repost
- Mar 17, 2026Vous connaissez peut être le repository Github awesome-copilot (github.com/github/aweso...) contenant des skills, prompts, etc. pour Github… — @devdevdev.net1 likes and repost
- Feb 20, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 21,816 (+133) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Feb 5, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 20,129 (+137) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Jan 28, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 19,270 (+147) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Jan 15, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 17,630 (+180) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Dec 31, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 15,940 (+100) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Dec 20, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 github / awesome-copilot ⭐ 14,836 (+217) 🗒 JavaScript Community-contributed instructions, prompts,… — @github-trending.bsky.social1 likes and repost
- Dec 19, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 14,605 (+172) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Dec 6, 2025📦 github / awesome-copilot ⭐ 13,645 (+52) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social1 likes and repost
- Nov 23, 202511월의 남은 쿼터를 소진하기 위한 작업은 Chatmode + Agent 지원방법에 대한 공부. 이번달은 대부분 직접 코딩하거나, GPT5-mini를 사용했기 때문에 Sonnet 펑펑 돌리면서 공부해도 되겠다. Chatmode 기반으로 작업할때는… — @luncliff.bsky.social1 likes and repost
- Nov 12, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 11,788 (+110) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Nov 1, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 10,993 (+115) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Oct 1, 2025📦 github / awesome-copilot ⭐ 8,546 (+91) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending.bsky.social1 likes and repost
- Sep 23, 2025Join the AMA at 4PM SF time, here: discord.gg/YZbkuKb3?eve... Check out the awesome-copilot repo, here: github.com/github/aweso... — @nonfamous.bsky.social1 likes and repost · 1 reply
- Aug 15, 2025Shape Copilot to your workflow. Use the Awesome-Copilot repo’s custom instructions, reusable prompts, and chat modes to get AI suggestions… — @martinrojas.dev1 likes and repost
- Jul 2, 2025Awesome GitHub Copilot Customizations github.com/github/aweso... #GitHub #Copilot #GitHubCopilot — @yzhums.bsky.social1 likes and repost
- Jan 22, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 18,469 (+149) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
On GitHub · 34
- Apr 12, 2026[Bug]: `npx skills update <skill-name>` adds all other skills from the skill repo — vercel-labs/skills46 reactions · 8 comments
- Jul 9, 2025Support for *.instructions.md files in IntelliJ for project-scoped Copilot customization — microsoft/copilot-intellij-feedback25 reactions · 9 comments
- Apr 26, 2026[Bug]: `npx skills update` downloads entire repository instead of specific skill when using subpaths — vercel-labs/skills6 reactions · 4 comments
- Jul 16, 2026docs(agent-skills): point the public catalog at the public org — chainguard-dev/edu2 reactions · 3 comments
- Jun 21, 2026[Feature]: Is there a way to specify .github/skills as the install location for skills? — vercel-labs/skills2 reactions
29 more on GitHub
- Oct 31, 2025Links to awesome-copilot are broken and result in 404 — github/docs2 reactions · 2 comments
- Oct 30, 2026feat(skills): add public Git installation to the CLI — alex-de-haas/docker-host1 reaction · 2 comments
- Oct 28, 2026docs(skills): correct the [dependabot skip] wording in the dependabot skill — docdyhr/mcp-wordpress1 reaction · 3 comments
- Sep 25, 2026Unblock learning-hub activation job by bumping blocked gh-aw compile version — Vbddr/awesome-copilot1 reaction · 1 comment
- Sep 24, 2026Automate agent package releases — socialbu/socialbu-agent1 reaction · 13 comments
- Sep 20, 2026fix(deps): clear Critical Dependabot alert for astro — Wicked-Sick-Ltd/awesome-copilot1 reaction
- Sep 20, 2026fix(security): CodeQL clear-text storage + hostBridge allowlist (#1–#2) — Wicked-Sick-Ltd/awesome-copilot1 reaction
- Sep 10, 2026Create Skill.md — 1napz/crystalcastleX1 reaction
- Sep 4, 2026fix(plugin): conform manifest to Agent Plugins 1.0.0 — BigCactusLabs/blotter1 reaction · 1 comment
- Aug 31, 2026fix(agents): launch Droid at High autonomy in yolo mode — stablyai/orca1 reaction · 3 comments
- Aug 21, 2026chore(skills): awesome-copilot update candidate 83561bd7 — KraineOpasen/bukerov-twitch-miner-go1 reaction
- Aug 10, 2026Bundled github-issues skill documents an unsafe shell-quoting pattern, and its locus is a synced file — devantler-tech/agent-plugins1 reaction · 1 comment
- Jul 23, 2026Plugin plan — charlyautomatiza/playwright-plugin1 reaction
- Jun 9, 2026Problem with the description length on using `az boards work-item create` — Azure/azure-cli1 reaction · 4 comments
- May 26, 2026[BUG] Unable to specify Skills/Agents when installing via the UI — runkids/skillshare1 reaction · 1 comment
- May 16, 2026[Ensure Agent skills follow the standards] — ralphke/Agentic-Coding1 reaction · 3 comments
- Apr 13, 2026Simplify, transfer/reorganize `.github/copilot-instructions.md` into `AGENTS.md` and other more appropriate agent context files — huanshankeji/compose-multiplatform-html-unified1 reaction
- Apr 9, 2026[broken-links] Broken external links detected (2 confirmed 404s) — htekdev/gh-aw-overview1 reaction
- Mar 31, 2026Add the awesome-copilot repo-architect agent to this repository — derecskey/valleypaintingco1 reaction
- Mar 22, 2026Add createagents.md skill — sparkfabrik/sf-agents-harness1 reaction
- Mar 22, 2026Code architecture inspection — davidamitchell/Research1 reaction
- Mar 10, 2026Git fatal: destination path error due to Windows long paths in Extensions view — microsoft/vscode1 reaction
- Mar 4, 2026Migrate to copilot-sdk — george-cz/ai-plan-comparator1 reaction
- Feb 26, 2026Create .NET package to collect and summarize Azure Skills for an Azure Service — diberry/microsoft-mcp-doc-generation1 reaction
- Feb 12, 2026ai-agents repository is showing 0 available in Marketplace — rjmurillo/skill-installer1 reaction · 3 comments
- Feb 6, 2026Add plugins for other Microsoft owned MCPs (Docs, playwright, etc). — github/copilot-plugins1 reaction · 2 comments
- Dec 25, 2025リポジトリ内の全ファイルの日本語への翻訳 — yamayuski/awesome-copilot1 reaction
- Dec 20, 2025Agent Capability Gaps: Comparison with awesome-copilot — rjmurillo/ai-agents1 reaction · 4 comments
- Oct 19, 2025File protocol handler for installing custom instructions, prompts, and chat modes — github/CopilotForXcode1 reaction
On YouTube · 5
- Mar 28, 2026What are Skills, Agents, Prompts, Instructions and how to use them? — Software Developer Diaries78k views · 29 comments
- Dec 20, 2025Manage Agents, Instructions, Prompts, & Skills in Seconds with this VS Code Extension — James Montemagno33k views · 12 comments
- Apr 1, 202610 GitHub Copilot Tricks Most Developers Don't Know (2026) — TechWhistle31k views · 14 comments
- Oct 2, 2025GitHub - github/awesome-copilot: Community-contributed instructions, prompts, and configurations ... — GitHub Daily Trend AI Podcast532 views
- Oct 17, 2026awesome-copilot: AI Coding Assistance with Community Agents & Plugins — Next Horizon152 views · 1 comment
On Hacker News · 5
- Nov 11, 2025Copilot modes you probably didn't know exist4 points · 1 comment
- Aug 10, 2025Awesome-copilot: Community-contributed instructions, prompts, and configurations3 points
- Feb 17, 2026Rug – Repeat Until Good1 point
- Dec 22, 2025Gilfoyle code review agent skill that roasts your code1 point
- Oct 28, 2025GitHub Copilot Customizations1 point
On the web · 1
- Apr 8, 2026suggest-awesome-github-copilot-instructions — AI agent skill — explainx.ai
In this repository484 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/foundry-agentic-loop/evals/fixtures/improve-history/AGENTS.mdAGENTS.md
- skills/foundry-agentic-loop/evals/fixtures/rapid-locked/AGENTS.mdAGENTS.md
- skills/foundry-agentic-loop/evals/fixtures/sdd-deployed/AGENTS.mdAGENTS.md
- skills/foundry-agentic-loop/evals/fixtures/sdd-paused/AGENTS.mdAGENTS.md
- skills/foundry-agentic-loop/evals/fixtures/team-conventions/AGENTS.mdAGENTS.md
- skills/repo-standardizer/templates/AGENTS.mdAGENTS.md
- skills/setup-my-iq/assets/templates/AGENTS.mdAGENTS.md
- skills/repo-standardizer/templates/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agentic-workflowsSkill
- code-reviewSkill
- create-canvas-extensionSkill
- acquire-codebase-knowledgeSkill
- acreadiness-assessSkill
- acreadiness-generate-instructionsSkill
- acreadiness-policySkill
- ad-campaign-analyzerSkill
- add-educational-commentsSkill
- adobe-illustrator-integrationsSkill
- adobe-illustrator-scriptingSkill
- agent-architectureSkill
- agent-governanceSkill
- agentic-evalSkill
- agent-owasp-complianceSkill
- agent-skill-stackSkill
- agent-supply-chainSkill
- ai-prompt-engineering-safety-reviewSkill
- ai-readySkill
- ai-team-orchestrationSkill
- anti-ui-slopSkill
- api-breaking-change-detectorSkill
- appinsights-instrumentationSkill
- apple-appstore-reviewerSkill
- architecture-blueprint-generatorSkill
- arch-linux-triageSkill
- arduino-azure-iot-edge-integrationSkill
- arize-ai-provider-integrationSkill
- arize-annotationSkill
- arize-datasetSkill
- arize-evaluatorSkill
- arize-experimentSkill
- arize-instrumentationSkill
- arize-linkSkill
- arize-prompt-optimizationSkill
- arize-traceSkill
- aspireSkill
- aspnet-minimal-api-openapiSkill
- audit-integritySkill
- automate-thisSkill
- autoresearchSkill
- aws-cdk-python-setupSkill
- aws-cloudwatch-investigationSkill
- aws-cost-optimizeSkill
- aws-resource-health-diagnoseSkill
- aws-resource-querySkill
- aws-well-architected-reviewSkill
- az-cost-optimizeSkill
- azure-architecture-autopilotSkill
- azure-container-registry-cliSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 14
Ask only what the spec does not answer: persistence (in-memory vs database), authentication, package name.
- Very specific: line 18
Check unique operationIds (they become method names), tags (they become one interface each), reusable components/schemas, required lists, …
- Very specific: line 105
Use <importMappings>/<typeMappings> only when a schema must map to an existing class.
- Distinctive: line 113
Never edit generated sources.
- Very specific: line 117
Follow the spring-boot-testing skill: @WebMvcTest slices per controller (mock the service), @SpringBootTest + MockMvc for the happy path …
- Very specific: line 119
Run ./mvnw verify or ./gradlew build, then start the app and curl one endpoint plus /actuator/health.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spring Boot application from an OpenAPI spec
Spec-first: the OpenAPI file is the source of truth. Generate interfaces and DTOs only at build time (never commit generated code), then hand-write the implementation. Verified with Spring Boot 4.0.8 and 4.1.1, openapi-generator 7.26.0 (Maven plugin, Gradle Groovy and Kotlin DSL), JDK 21+.
Step 0: Detect and gather
- Existing
pom.xml/build.gradle(.kts): keep its build tool and Spring Boot version, never upgrade implicitly, add the generator to it. Otherwise create the project with thecreate-spring-boot-java-projectskill (dependencies:web,validation,actuator; adddata-jpa,postgresql,securityonly if needed). - Get the spec (file, URL or pasted) and save it as
src/main/resources/openapi/<name>.yaml. Accept 3.0.x and 3.1.x; Swagger 2.0 must be converted first. - Ask only what the spec does not answer: persistence (in-memory vs database), authentication, package name.
Step 1: Review the spec
Check unique operationIds (they become method names), tags (they become one interface each), reusable components/schemas, required lists, validation constraints (minLength, maximum, pattern), error responses and securitySchemes. Flag gaps and fix the spec rather than the generated code.
Step 2: Configure the generator
Pin the version in a property; check the latest on Maven Central or the generator docs before changing it.
Maven (pom.xml, in <build><plugins>, before spring-boot-maven-plugin):
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator.version}</version> <!-- 7.26.0 -->
<executions>
<execution>
<goals><goal>generate</goal></goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi/petstore.yaml</inputSpec>
<generatorName>spring</generatorName>
<apiPackage>com.example.petstore.api</apiPackage>
<modelPackage>com.example.petstore.api.model</modelPackage>
<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<requestMappingMode>api_interface</requestMappingMode>
<useSpringBoot4>true</useSpringBoot4>
<useJackson3>true</useJackson3>
<useSpringBuiltInValidation>true</useSpringBuiltInValidation>
<useTags>true</useTags>
<skipDefaultInterface>true</skipDefaultInterface>
<openApiNullable>false</openApiNullable>
<documentationProvider>none</documentationProvider>
<annotationLibrary>none</annotationLibrary>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>Gradle (Groovy DSL; plugin id 'org.openapi.generator' version '7.26.0'):
openApiGenerate {
generatorName = 'spring'
inputSpec = "$projectDir/src/main/resources/openapi/petstore.yaml".toString()
outputDir = layout.buildDirectory.dir('generated/openapi').get().asFile.path
apiPackage = 'com.example.petstore.api'
modelPackage = 'com.example.petstore.api.model'
generateApiTests = false
generateModelTests = false
generateSupportingFiles = false
configOptions = [interfaceOnly: 'true', requestMappingMode: 'api_interface', useSpringBoot4: 'true', useJackson3: 'true', useSpringBuiltInValidation: 'true', useTags: 'true',
skipDefaultInterface: 'true', openApiNullable: 'false', documentationProvider: 'none', annotationLibrary: 'none']
}
sourceSets.main.java.srcDir layout.buildDirectory.dir('generated/openapi/src/main/java')
tasks.named('compileJava') { dependsOn 'openApiGenerate' }Gradle (Kotlin DSL; plugin id("org.openapi.generator") version "7.26.0", resolved from the Gradle plugin portal, so keep gradlePluginPortal() in pluginManagement):
openApiGenerate {
generatorName.set("spring")
inputSpec.set("$projectDir/src/main/resources/openapi/petstore.yaml")
outputDir.set(layout.buildDirectory.dir("generated/openapi").get().asFile.path)
apiPackage.set("com.example.petstore.api")
modelPackage.set("com.example.petstore.api.model")
generateApiTests.set(false)
generateModelTests.set(false)
generateSupportingFiles.set(false)
configOptions.set(mapOf("interfaceOnly" to "true", "requestMappingMode" to "api_interface", "useSpringBoot4" to "true", "useJackson3" to "true", "useSpringBuiltInValidation" to "true", "useTags" to "true",
"skipDefaultInterface" to "true", "openApiNullable" to "false", "documentationProvider" to "none", "annotationLibrary" to "none"))
}
sourceSets.main { java.srcDir(layout.buildDirectory.dir("generated/openapi/src/main/java")) }
tasks.compileJava { dependsOn("openApiGenerate") }Option notes:
- Spring Boot 3.x: drop
useSpringBoot4anduseJackson3(useSpringBoot3=trueis the default). Boot 4 needs both options; Jackson 3 is only allowed withuseSpringBoot4. - Request-parameter validation: for Boot 3.2+/4 (Framework 6.1+), keep
useSpringBuiltInValidation=truein all build-tool configurations. It omits type-level@Validatedfrom generated API interfaces so MVC handles constrained query/path parameters throughHandlerMethodValidationException. For Boot 3.0/3.1, leave this optionfalseto retain AOP validation and explicitly map request-parameterConstraintViolationExceptionto HTTP 400 with the spec's error body. Do not blanket-map service-layer constraint violations to 400. Never patch generated interfaces to change validation behavior. - Base paths:
requestMappingMode=api_interfaceputs the class-level base-path mapping on the interface when no controller is generated. Forservers: [{url: /v1}]and path/pets, verify/v1/pets; do not add the same/v1prefix again through controller mappings,server.servlet.context-pathor proxy rewriting. interfaceOnly=truegenerates<Tag>Apiinterfaces (with@RequestMapping/validation annotations) and models.delegatePattern=true(instead) generates controllers calling a<Tag>ApiDelegateyou implement; preferinterfaceOnly, it is simpler. If you usedelegatePattern(verified on Boot 4.1.1): dropskipDefaultInterface(it breaks the generated delegate, compile errors); generate onlyApiUtil.javaas supporting file, otherwise the default delegate methods fail withcannot find symbol ApiUtiland a full set of supporting files adds anOpenApiGeneratorApplicationmain class (Unable to find a single main classinbootJar): Maven<supportingFilesToGenerate>ApiUtil.java</supportingFilesToGenerate>instead of<generateSupportingFiles>false</generateSupportingFiles>, GradleglobalProperties = [apis: '', models: '', supportingFiles: 'ApiUtil.java']. The generated<Tag>ApiControlleris a@ControllerinapiPackage: it must be under the@SpringBootApplicationpackage (e.g.com.example.demo.api), otherwise it is not scanned and the endpoints return 404.documentationProvider=noneandannotationLibrary=noneavoid pulling springdoc/swagger annotations into the generated code. Serving the spec/Swagger UI is optional: addorg.springdoc:springdoc-openapi-starter-webmvc-ui(3.x line for Boot 4, 2.8.x for Boot 3) only if requested; verified with springdoc 3.1.1 on Boot 4.1.1 (/v3/api-docsreturns OpenAPI 3.1 JSON,/swagger-ui/index.htmlreturns 200).openApiNullable=falseavoids thejackson-databind-nullabledependency; keep ittrueonly if the spec has PATCH semantics with nullable fields.- Generated models use
jakarta.validation:spring-boot-starter-validationmust be on the classpath. Required properties become constructor arguments in generated order; read the generated class intarget/generated-sources/openapi(orbuild/generated/openapi) before calling constructors. - Use
<importMappings>/<typeMappings>only when a schema must map to an existing class.
Step 3: Implement
- One
@RestControllerper generated<Tag>Apiinterface,implementsit, no extra mapping annotations (they are inherited from the interface). Keep controllers thin; put logic in@Serviceclasses and return DTOs, not entities. Map entities to generated DTOs explicitly (a MapStruct mapper if the project already uses it). - Persistence: in-memory only when asked; otherwise Spring Data JPA entities and repositories separate from the generated DTOs, PostgreSQL via Docker Compose for dev, and schema handling per the schema management rule of the
java-hibernate-jpaskill (Flyway or Liquibase for production). See thejava-springbootskill. - Errors: use
@RestControllerAdviceto preserve each operation's declared error status, media type and response schema, including validation failures. HandleMethodArgumentNotValidExceptionfor request bodies and, on Boot 3.2+/4,HandlerMethodValidationExceptionfor query/path parameters; override the corresponding handlers when extendingResponseEntityExceptionHandler. Return RFC 9457ProblemDetailonly when the spec declares it; otherwise return the declared error DTO instead of Spring's default validation response. If error responses are missing or ambiguous, ask before changing the contract rather than imposing Problem Details or a blanket 400/404/409 policy. - Security: map
securitySchemeswith thespring-securityskill (JWT resource server, API key filter, method security). Do not generateuseSpringSecurityPreAuthorizeunless scopes are declared. - Never edit generated sources; change the spec or the generator options and rebuild.
Step 4: Test and verify
- Follow the
spring-boot-testingskill:@WebMvcTestslices per controller (mock the service),@SpringBootTest+ MockMvc for the happy path and one validation failure per write operation, Testcontainers with@ServiceConnectionfor database code (seejava-testcontainers). - Cover every operation in the spec: success, not found, invalid input. Test invalid constrained query/path parameters as well as invalid request bodies. For error responses, including validation failures, assert the declared status, content type and body schema, not just the status code. Optionally assert the spec itself stays valid in CI with
openapi-generator validate -i <spec>or by letting the build fail on generation errors. - Run
./mvnw verifyor./gradlew build, then start the app andcurlone endpoint plus/actuator/health. Include an endpoint from a spec with a non-root server URL and assert its full path, so a missing or duplicated base prefix is caught. - Report: spec issues found, generator version and options, files written, anything deferred.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

