Skip to content

Replace cebe/php-openapi#11

Merged
freost merged 11 commits into
masterfrom
ditch-cebe-php-openapi
Jul 17, 2026
Merged

Replace cebe/php-openapi#11
freost merged 11 commits into
masterfrom
ditch-cebe-php-openapi

Conversation

@freost

@freost freost commented Jul 2, 2026

Copy link
Copy Markdown
Member

Type


Yes/No
Bugfix? No
New feature? No
Other? Yes

Additional information

Yes/No
Has backwards compatibility breaks? No
Has unit and/or integration tests? Yes

Description


The cebe/php-openapi package is no longer actively maintained so I'm replacing it with our own custom OpenApi spec parser for route generation.

@freost freost changed the title WIP Reø Jul 3, 2026
@freost freost changed the title Reø Replace cebe/php-openapi Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) producing Operation/Parameter objects for routing.
  • Updates the routing generator to consume parsed operations instead of cebe/php-openapi objects.
  • 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.

Comment thread src/parser/ReferenceResolver.php Outdated
Comment thread src/parser/Parser.php
Comment thread CHANGELOG.md
Comment thread src/generators/routing/Generator.php
@freost
freost marked this pull request as ready for review July 17, 2026 09:05
@freost
freost merged commit c1c7521 into master Jul 17, 2026
4 checks passed
@freost
freost deleted the ditch-cebe-php-openapi branch July 17, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants