apie/schema-generator
Generates JSON Schema components from PHP objects with type hints, tailored for Apie entities, value objects, DTOs, enums, lists, and hashmaps. Produces cebe/php-openapi schema objects, focusing on schema sections (not full OpenAPI documents).
"This package automates 90% of our API documentation work by generating OpenAPI schemas directly from our PHP classes—DTOs, entities, and enums. For example, instead of manually writing YAML for a UserProfile DTO, we’ll auto-generate it from the class definition. This cuts documentation time by 80%, reduces errors from drift between code and docs, and aligns with our API-first roadmap. It’s a low-risk, high-reward tool (MIT license, PHP-native) that pays for itself in developer hours. We’ll pilot it on our /users API to prove ROI before scaling."
Key Outcomes: ✅ Faster releases (no manual schema updates). ✅ Consistent contracts (schemas stay in sync with code). ✅ Lower tooling costs (no SaaS subscriptions).
*"This is a schema generator for PHP classes that outputs OpenAPI-compliant JSON schemas via cebe/php-openapi. It’s ideal for Laravel apps with typed DTOs/entities because it:
set* methods).$ref: '#/components/schemas/Gender-post') for reusable components.#[SchemaMethod] for edge cases.Why not alternatives?
Implementation Plan:
Order, User, Payment).git push.#[SchemaMethod] for custom schemas (e.g., password fields).Trade-offs:
Next Steps:
UserDto class to validate output.How can I help you explore Laravel packages today?