# php openapi generator

> Generate valid OpenAPI 3.0 specifications directly from PHP routes, controllers, and validation logic.

php openapi generator is a paid AI agent skill on Agensi by Dawood Morris Kaundama, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $7.2 (one-time purchase)
- Creator: [Dawood Morris Kaundama](https://www.agensi.io/creators/dawood-morris-kaundama)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-08-10
- Security: scan passed (2026-08-10); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/php-openapi-generator
- Tags: api, php, laravel, documentation, swagger, backend-development

## About this skill

### The problem

Writing OpenAPI specs for legacy or undocumented PHP APIs is tedious and prone to human error. Developers often waste hours manually syncing YAML files with their Laravel, Slim, or plain PHP route and controller logic.

### What it does

- Scans PHP route files and controllers to identify HTTP methods, paths, and parameters.
- Extracts request validation rules and response shapes directly from the source code.
- Maps PHP data structures to valid OpenAPI 3.0 types (string, integer, boolean, etc.).
- Organizes repeated data structures into reusable components and schemas via $ref.
- Detects authentication middleware and security requirements like Bearer tokens or API keys.

### Frameworks & tools

Supports Laravel, Slim, and plain PHP. Generates OpenAPI 3.0.3 YAML compatible with Swagger UI, Redoc, and Postman.

### Why this beats prompting it yourself

Generic prompts often hallucinate endpoints or invent response fields that do not exist. This skill follows a strict extraction logic that prioritizes code-level evidence, marking gaps with TODO comments instead of fabricating data.

### Use cases

- Documenting an existing Laravel API for a new frontend team.
- Generating a spec file to bootstrap client SDK generation.
- Creating a Postman collection source for manual testing.
- Audit of internal endpoints for security and compliance reviews.

### Known limitations

Designed for documenting existing code only, not for scaffolding new endpoints. Requires access to both route definitions and controller logic for accurate schema generation.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the php openapi generator skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill differ from manually writing OpenAPI/Swagger documentation?

This skill scans your actual PHP source code—including route files, controller methods, and validation logic—to build an OpenAPI 3.0 spec. It eliminates manual YAML writing and prevents 'documentation rot' by ensuring your API spec matches your actual code.

### Which PHP frameworks and AI agents are supported?

The skill is optimized for Laravel and Slim frameworks, but it also supports custom PHP implementations. It is compatible with major AI agents that have filesystem access, allowing it to parse your directory structure and files.

### Can I use this skill to generate PHP code from an existing OpenAPI file?

No, this skill is designed specifically for 'code-first' documentation of existing APIs. It extracts schemas from your current codebase rather than scaffolding new routes or boilerplate from a design doc.

### What specific metadata does the skill extract from my PHP controllers?

The generator extracts path parameters, request body schemas from validation rules, and response shapes from controller returns. It also identifies authentication requirements by analyzing your route middleware and headers.

### What exactly is included in my purchase?

You will receive the AI agent skill configuration, detailed instructions for integration, and any necessary logic required to run the extraction process. You also get lifetime access to any updates or improvements made to the generator logic.

### What happens if my controller logic is too complex for the AI to parse?

While highly accurate, if the skill encounters complex dynamic logic it can't resolve, it will insert a TODO comment in the YAML rather than hallucinating data. This allows you to quickly find and manually verify edge cases.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
