chamber-orchestra/openapi-doc-bundle
#[Route] + #[Operation]). This aligns well with modern Symfony/Doctrine-based APIs but may require refactoring for traditional controller-based apps.OperationParserInterface, ComponentParserInterface) allows customization for niche use cases (e.g., GraphQL-like schemas, custom DTOs).symfony/attribute, symfony/console). Compatible with Symfony 8+ or standalone Symfony apps.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Parser Gaps | Medium | Extend parsers for unsupported types (e.g., custom validators, nested forms). |
| Performance | Low | Recursive scanning of src/ may slow CI/CD; cache OperationRegistry in production. |
| Attribute Conflicts | Medium | Ensure #[Operation]/#[Route] are exclusive to ADR actions (avoid mixing with controllers). |
| Schema Merging | Low | proto.yaml conflicts require manual resolution; document merge precedence rules. |
| PHP 8.5+ Dependency | High | Blocking for older stacks; evaluate polyfills or fork. |
#[Route] on invokable classes)? If not, what’s the migration effort?FormParser, ViewParser, etc.) cover all DTOs/responses in the codebase? If not, what’s the backlog for custom parsers?doc-version in the CLI suffice, or is a more robust strategy (e.g., semantic versioning in proto.yaml) needed?#[Route]) and type system features.doc.yaml.doc.yaml to generate SDKs/docs.Phase 1: Pilot Scope
#[Operation]/#[Route].php bin/console openapi-doc:generate.Phase 2: Parser Customization
GraphQLParser for #[GraphQLType] classes.Phase 3: CI/CD Integration
- name: Generate OpenAPI
run: php bin/console openapi-doc:generate --output=public/api-doc.yaml
spectral lint).Phase 4: Tooling Hooks
doc.yaml (e.g., OpenAPI Generator).| Component | Compatibility Notes |
|---|---|
| Symfony Controllers | ❌ Not supported; requires ADR refactor. |
| API Platform | ✅ Partial support; may need #[Operation] overrides for custom logic. |
| Doctrine Entities | ✅ Supported via ObjectParser (public properties). |
| Symfony Forms | ✅ Supported via FormParser (maps FormTypeInterface to OpenAPI schemas). |
| Custom DTOs | ⚠️ Requires custom ComponentParser (e.g., for @Assert constraints). |
| GraphQL | ❌ No native support; would need custom parser. |
| Legacy PHP (<8.5) | ❌ Blocking; consider polyfills or fork. |
#[Route]/#[Operation] usage.#[Property], #[Security]).#[IsGranted] support).spectral or openapi-linter to catch breaking changes.doc-version CLI flag or embed version in proto.yaml.DescriberException).missing-parsers.log.#[Operation] → No OpenAPI entry for the route.ObjectParser or add a custom parser.proto.yaml merge precedence.# Dry-run with verbose output
php bin/console openapi-doc:generate --verbose
# Inspect registries
php bin/console debug:container ChamberOrchestra\OpenApiDocBundle\Registry\OperationRegistry
DescriberException cases.proto.yaml.OperationRegistry/ComponentRegistry in production (e.g., Redis) to avoid rescanning on every request.--src CLI flag to limit scanning (e.g., exclude tests/).Locator to use parallel file scanning (PHP 8.1+ SplFileInfo + pthreads).proto.yaml to override paths/responses per environment (e.g., dev.proto.yaml).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Parser Crashes | Broken OpenAPI output | Add @try-catch in parsers; log errors. |
| Attribute Misconfiguration | Missing endpoints in docs | L |
How can I help you explore Laravel packages today?