extract-openapi-from-code

Extract OpenAPI specifications from API codebases in JSON or YAML.

Updated Feb 23, 2026
One-click install
npx skills add https://github.com/berea-ch/bereach-sdk-ts --skill extract-openapi-from-code-berea-ch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract-openapi-from-code
Source: https://github.com/berea-ch/bereach-sdk-ts/tree/main/.agents/skills/extract-openapi-from-code
Command: npx skills add https://github.com/berea-ch/bereach-sdk-ts --skill extract-openapi-from-code-berea-ch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of OpenAPI specifications directly from your existing API codebase, eliminating the need for manual spec writing and ensuring consistency between your code and its documentation.

Core Features & Use Cases

  • Framework Support: Works with popular frameworks like FastAPI, Flask, Django, Spring Boot, NestJS, Hono, Rails, and Laravel.
  • Automated Extraction: Generates OpenAPI specs in JSON or YAML format.
  • Post-Extraction Validation & Refinement: Includes steps for linting the generated spec and applying overlays for corrections or adding Speakeasy extensions.
  • SDK Generation: Can be followed by SDK generation using Speakeasy.
  • Use Case: You've built a new REST API using FastAPI and need to generate an OpenAPI spec to create client SDKs for various languages.

Quick Start

Use the extract-openapi-from-code skill to generate an OpenAPI spec from your FastAPI project located at '/path/to/my-fastapi-project'.

Frequently Asked Questions about extract-openapi-from-code

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

FAQPage Schema
How do I generate an OpenAPI spec from existing FastAPI or NestJS code?

Generating an OpenAPI spec from FastAPI or NestJS code is done by automatically extracting route definitions and schemas from the codebase. This Skill parses frameworks like FastAPI, NestJS, and Spring Boot to output machine-readable JSON or YAML API specifications.

Can I extract OpenAPI specifications from Flask and Django projects?

Extracting OpenAPI specifications from Flask and Django projects is fully supported. The Skill analyzes Python, Node.js, Java, Ruby, and PHP codebases to convert existing API definitions into standardized OpenAPI documentation formats.

What's the best way to automate API documentation from a Spring Boot codebase?

Automating API documentation from a Spring Boot codebase is achieved by extracting OpenAPI specs directly from the source code. This eliminates manual spec writing and ensures your documentation stays perfectly consistent with your code definitions.

Does this OpenAPI extraction tool support Hono, Rails, and Laravel frameworks?

OpenAPI extraction supports Hono, Rails, and Laravel frameworks alongside others like FastAPI and Flask. It processes these codebases to generate API specifications, which can then be linted and refined using overlays.

How do I validate and refine an OpenAPI spec after extracting it from code?

Validating and refining an OpenAPI spec after extraction involves linting the generated file and applying overlays. This process corrects errors and can inject Speakeasy extensions to prepare the specification for client SDK generation.

Can I use the extracted OpenAPI spec to generate client SDKs?

Using the extracted OpenAPI spec to generate client SDKs is a primary use case. After extracting and validating the specification, you can pass it to Speakeasy for automated multi-language SDK generation.