Skip to content

fix: forward deprecated and example param fields from Action to Route#58

Merged
lohanidamodar merged 1 commit intomainfrom
fix-forward-param-fields
Apr 8, 2026
Merged

fix: forward deprecated and example param fields from Action to Route#58
lohanidamodar merged 1 commit intomainfrom
fix-forward-param-fields

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

Summary

  • Platform::initHttp(), initTasks(), and initWorker() were not forwarding deprecated and example fields when copying Action params to Route/Hook params
  • This caused SDK spec generation to lose custom example values defined on route parameters, producing minimal/default values in generated SDK docs instead of realistic examples
  • Added test to ensure all Action param fields are forwarded to Route, preventing future regressions

Test plan

  • composer format passes
  • composer lint passes
  • composer test passes (6 tests, 38 assertions)
  • Verify SDK spec generation produces correct x-example values after updating this dependency

…oute

Platform was not passing `deprecated` and `example` fields when registering
Action params as Route/Hook params, causing SDK spec generation to lose
custom example values defined on route parameters.
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 8, 2026

Greptile Summary

This PR fixes a bug where Platform::initHttp(), initTasks(), and initWorker() were silently dropping the deprecated and example fields when copying Action params to their corresponding Route/Hook params. The fix is a one-line addition of $option['deprecated'], $option['example'] to the param() call in each of the three init methods, applied consistently. A new TestActionWithParams fixture and a dedicated assertion test in HTTPServicesTest guard against future regressions.

Key changes:

  • src/Platform/Platform.php — Forwards deprecated and example in all three param() forwarding sites (initHttp, initTasks, initWorker).
  • tests/Platform/TestActionWithParams.php — New fixture Action that exercises named example and deprecated arguments.
  • tests/Platform/TestService.php — Registers the new fixture action.
  • tests/e2e/HTTPServicesTest.php — New test that asserts every expected param key exists on the resolved Route and verifies concrete example/deprecated values.

Minor note: The new test covers the initHttp path only (via Http::getRoutes()). Equivalent coverage for the initTasks and initWorker paths is not added, but those code paths are mechanically identical to initHttp, so the risk of divergence is low.

Confidence Score: 5/5

Safe to merge — the fix is minimal, correct, and consistently applied across all three init methods.

All changes are additive and targeted. The bug fix forwards two previously-omitted fields with no risk of breaking existing behaviour (both fields default to safe values). The new test directly validates the fix. No P0 or P1 findings were identified.

No files require special attention.

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
src/Platform/Platform.php Adds deprecated and example arguments to all three param() forwarding calls in initHttp(), initTasks(), and initWorker() — the fix is correct and applied consistently.
tests/Platform/TestActionWithParams.php New test fixture Action that registers a /with-params route with example and deprecated named params, covering the bug scenario.
tests/Platform/TestService.php Registers TestActionWithParams in the test service so the new route is available during HTTP tests.
tests/e2e/HTTPServicesTest.php Adds testActionParamFieldsForwardedToRoute() which asserts all param keys (including deprecated and example) are present on the registered Route and verifies concrete values.

Reviews (1): Last reviewed commit: "fix: forward `deprecated` and `example` ..." | Re-trigger Greptile

@lohanidamodar lohanidamodar merged commit 2a6b881 into main Apr 8, 2026
7 checks passed
@lohanidamodar lohanidamodar deleted the fix-forward-param-fields branch April 8, 2026 04:11
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