Skip to content

feat(server): @deprecated docblocks on controller methods for deprecated operations - #136

Merged
benjamineckstein merged 2 commits into
mainfrom
feat/deprecated-controller-docblocks
Jun 13, 2026
Merged

feat(server): @deprecated docblocks on controller methods for deprecated operations#136
benjamineckstein merged 2 commits into
mainfrom
feat/deprecated-controller-docblocks

Conversation

@benjamineckstein

Copy link
Copy Markdown
Contributor

What

When an OpenAPI operation is marked deprecated: true, the generated abstract controller method now carries an @deprecated line in its PHPDoc. This extends the existing @deprecated convention (already emitted on generated Data classes) to the server scaffold, closing one of the ROADMAP "Toward 1.0.0" follow-ups.

Changes

  • OperationDescriptor gains a bool $deprecated property (symmetric with the schema-level @deprecated tag).
  • OperationCollector::describe() sets it from the already-parsed OperationNode::$deprecated (no parser change needed; the reader already surfaced operation-level deprecated).
  • ControllerGenerator::renderMethod() emits a plain @deprecated line (OpenAPI's operation deprecated is a bare boolean, so no reason text, matching the Data-class side), composing cleanly with the existing ::fromQuery/::fromRoute/::fromHeaders docblock pointers.
  • New DeprecatedOperationTest proves a deprecated operation yields the docblock and a non-deprecated one does not.

Output-shape change (rebaseline)

This shifts generated output for 22 corpus specs that contain deprecated operations (github, stripe, openai, jira, zoom, ...). Rebaselined via the project's intentional-rebaseline mechanism: a documented READER_BASELINE_REBASELINED_DEPRECATED_CONTROLLER_DOCBLOCKS constant pins exactly those 22 specs, and only their hashes are refreshed (22 insertions / 22 deletions, format preserved). The 5 post-freeze OpenAPI 3.2 specs are untouched. The petstore example, writable drift fixture, and ServerScaffold snapshot use specs with no deprecated operations, so none changed.

Gates (local, all green)

composer test 2185 passed / 5 skipped, test:type 100%, stan clean, Pint clean, deptrac 0.

@github-actions

Copy link
Copy Markdown
Contributor

Qodana for PHP

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 12 dependencies

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
doctrine/deprecations 1.1.6 MIT
phpdocumentor/reflection-common 2.2.0 MIT
phpdocumentor/reflection-docblock 6.0.3 MIT
phpdocumentor/type-resolver 2.0.0 MIT
phpstan/phpdoc-parser 2.3.2 MIT
spatie/laravel-data 4.23.0 MIT
spatie/laravel-package-tools 1.93.1 MIT
spatie/php-structure-discoverer 2.4.2 MIT
symfony/finder v8.1.0 MIT
symfony/polyfill-ctype v1.37.0 MIT
symfony/yaml v8.1.0 MIT
webmozart/assert 2.4.0 MIT
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@benjamineckstein
benjamineckstein merged commit 13b355b into main Jun 13, 2026
14 checks passed
@benjamineckstein
benjamineckstein deleted the feat/deprecated-controller-docblocks branch June 15, 2026 05:59
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.

1 participant