openapi-doc-gen

Generate the latest Swagger/OpenAPI specification for Spring Boot applications.

Updated Jul 2, 2025
One-click install
npx skills add https://github.com/junechen7414/SpringBoot --skill openapi-doc-gen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi-doc-gen
Source: https://github.com/junechen7414/SpringBoot/tree/main/.bob/skills/openapi-doc-gen
Command: npx skills add https://github.com/junechen7414/SpringBoot --skill openapi-doc-gen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the manual effort and environment setup needed to regenerate the latest OpenAPI specification for a Spring Boot service, especially when documentation must stay in sync with the implementation.

Core Features & Use Cases

  • OpenAPI Generation Workflow: Produces the latest swagger.json by running the project’s dedicated documentation task.
  • Profile-Aware Execution: Switches to the openapi profile so the app can start with H2 instead of requiring Oracle connectivity.
  • API Documentation Refresh: Useful when updating endpoint definitions, validating the current API surface, or rebuilding docs in CI after backend changes.

Quick Start

Ask the AI to regenerate the latest swagger.json for this Spring Boot project using the openapi profile and verify the output file is created successfully.

Frequently Asked Questions about openapi-doc-gen

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

FAQPage Schema
How do I generate OpenAPI documentation for a Spring Boot application?

Generate OpenAPI documentation for a Spring Boot application by running the generateOpenApiDocs task. This executes a build-time workflow that writes the latest API specification directly to build/docs/swagger.json.

Can I generate Swagger docs without connecting to an Oracle database?

Yes, you can generate Swagger docs without Oracle by activating the openapi profile. This switches the Spring Boot startup to use an H2 database, allowing the application to boot successfully for documentation generation without external database connectivity.

What is the openapi profile used for in Spring Boot API documentation generation?

The openapi profile is used to start a Spring Boot application with an H2 database instead of Oracle. This enables the application to boot in a lightweight environment specifically to run the generateOpenApiDocs task and output the swagger.json file.

How do I automate API spec regeneration in CI for Spring Boot?

Automate API spec regeneration in CI by running the generateOpenApiDocs task with the openapi profile. This validates API changes and rebuilds the swagger.json file automatically after backend updates, ensuring documentation stays synchronized with implementation.

Do I need a specific Gradle task to refresh swagger.json in Spring Boot?

Yes, you need to execute the generateOpenApiDocs Gradle task to refresh swagger.json. Combined with the openapi profile for H2-backed startup, this task handles the complete workflow of writing the updated OpenAPI specification to build/docs/swagger.json.

Why does my Spring Boot swagger.json generation fail with Oracle dependency errors?

Swagger.json generation fails with Oracle dependency errors because the application cannot establish a database connection during startup. You must activate the openapi profile to use H2 instead, bypassing the Oracle requirement and allowing the generateOpenApiDocs task to complete.