Replace cebe/php-openapi#11
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Replaces the unmaintained cebe/php-openapi dependency with a custom OpenAPI spec parser used for route generation, and adds CI + unit test coverage around parsing and $ref resolution.
Changes:
- Introduces a custom OpenAPI parser (
Parser,ReferenceResolver) producingOperation/Parameterobjects for routing. - Updates the routing generator to consume parsed operations instead of
cebe/php-openapiobjects. - Adds PHPUnit test suite + fixtures, a GitHub Actions test workflow, and supporting dev dependencies.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/parser/ReferenceResolver.php | New $ref resolver with caching and circular-reference detection. |
| src/parser/Parser.php | New parser that extracts operations and normalizes/resolves parameters/schemas. |
| src/parser/Operation.php | DTO for parsed operations. |
| src/parser/Parameter.php | DTO for parsed parameters. |
| src/parser/exceptions/ParserException.php | Custom exception type for parser failures. |
| src/generators/routing/Generator.php | Migrates route generation from cebe/php-openapi to the new parser output model. |
| tests/TestCase.php | Adds shared PHPUnit base test case (Mockery integration). |
| tests/bootstrap.php | Adds test bootstrap configuration and autoloading. |
| tests/unit/parser/ParserTest.php | Unit tests for parsing basic specs, parameters, refs, and error cases. |
| tests/unit/parser/ReferenceResolverTest.php | Unit tests for reference resolution behavior and error handling. |
| tests/unit/parser/fixtures/basic.yaml | Fixture for basic parsing tests. |
| tests/unit/parser/fixtures/parameters.yaml | Fixture for parameter parsing/override tests. |
| tests/unit/parser/fixtures/references.yaml | Fixture for valid local $ref resolution tests. |
| tests/unit/parser/fixtures/invalid-references.yaml | Fixture for non-local and circular $ref tests. |
| tests/unit/parser/fixtures/missing-paths.yaml | Fixture for missing paths error handling. |
| tests/unit/parser/fixtures/missing-operation-id.yaml | Fixture for missing operationId error handling. |
| phpunit.xml | Adds PHPUnit configuration for running unit tests. |
| .github/workflows/tests.yml | Adds CI workflow to run PHPUnit on pushes/PRs/schedule. |
| composer.json | Removes cebe/php-openapi, adds symfony/yaml, PHPUnit, Mockery, and test autoloading. |
| phpstan-baseline.neon | Updates baseline file (currently empty in this PR). |
| README.md | Adds tests workflow badge. |
| CHANGELOG.md | Notes removal of cebe/php-openapi dependency in 4.1.0 entry. |
Comments suppressed due to low confidence (1)
phpstan-baseline.neon:2
- phpstan.neon includes phpstan-baseline.neon, but the baseline file is currently empty. Depending on PHPStan/NEON parsing behavior this can fail config merging; at minimum it’s clearer to keep it as a valid (empty) config file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
freost
marked this pull request as ready for review
July 17, 2026 09:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Additional information
Description
The
cebe/php-openapipackage is no longer actively maintained so I'm replacing it with our own custom OpenApi spec parser for route generation.