OpenAPI Docs Generator
Generate OpenAPI 3.x documentation directly from Spatie Laravel Data DTOs. No intermediate annotation files, no UI bundling — just your DTOs reflected into api-docs.json (and optionally YAML), merged with any hand-written controller annotations.
This is the same generator that produces the spec behind docs.langsys.dev/api. langsys/swagger-auto-generator is the abandoned predecessor; use this package.
How it works
Section titled “How it works”php artisan openapi:generate | +-- Scan controller annotations (zircote/swagger-php) +-- (Filtered sets) Select operations by their route's middleware +-- Reflect on Spatie Data DTOs → build OpenAPI Schema objects in memory +-- Discover error classes → error schemas and reusable responses +-- Merge DTO and error schemas into the OpenAPI model +-- Attach error responses to operations (#[Throws], implied_errors, rules) +-- Prune components/tags nothing references +-- Inject security definitions from config +-- Write api-docs.json / api-docs.yamlDTO-generated schemas are additive: if a schema with the same name already exists from your annotations, the annotation version wins.
In this package
Section titled “In this package” Install Requirements, Composer, config publish, and a one-DTO quick start. Attributes Example, Description, Omit, GroupedCollection, ItemType. Types & collections PHP → OpenAPI mapping, Optional, v3/v4 collections, Resource wrappers. API errors Error class contract, templates, #[Throws], and implied errors. Example generation How missing #[Example] values are filled from Faker. Artisan commands openapi:generate, thunder, dto, make-processor. Configuration Multiple sets, filtered specs, pruning, security, processors. Thunder Client Collections from api-docs.json, auth, merge behavior. Viewing & usage Viewers, the facade, and tests.