openapi-laravel: generate laravel-data classes and a server scaffold from an OpenAPI spec #310
benjamineckstein
started this conversation in
Package Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A spec-first generator that turns an OpenAPI document into Laravel code, built on top of spatie/laravel-data.
From a single spec it generates Data classes with validation
rules()derived from the spec (formats, bounds, patterns, required fields), PHP backed enums, readOnly/writeOnly request and response variants, nested objects and collections, andoneOf/anyOfas native PHP union types. Optionally it can also scaffold abstract controllers per tag plus a routes file, typed by the generated Data classes, so the spec stays the single source of truth.To be upfront: it is a young package (currently 0.4.0), but it ships with a thorough test suite (580 tests, plus a corpus of 128 real-world OpenAPI specs that must all generate valid PHP).
GitHub: https://github.com/codewithagents/openapi-laravel
Docs: https://openapi-laravel.codewithagents.de
Packagist: https://packagist.org/packages/codewithagents/openapi-laravel
All reactions