feat: add OpenAPI-generated API client#11
Merged
Conversation
generated client lives in src/Client/ (namespace Convoy\Client via the existing PSR-4 rule) from convoy's docs/v3/openapi3.yaml via OpenAPI Generator 7.23.0 (pinned in scripts/generate.sh). the hand-written SDK (rest of src/, incl. webhook verify) is untouched by generation. - sdk_generation.yaml matches the frain-dev/convoy dispatcher contract (same filename and inputs as the other SDK repos); tests before opening a regen PR - ci.yml adds GitHub Actions tests (repo previously had none) - offline contract tests prove verb/path/auth/version-header/body and that arbitrary event data payloads round-trip without dropping keys - composer: php ^8.1 + guzzle for the generated client; hand-written PSR-18 stack unchanged
1 task
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c207fd0. Configure here.
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.



Summary
/api/v1client undersrc/Client/(namespaceConvoy\Client, mapped by the existing PSR-4 rule) via OpenAPI Generator (pinned 7.23.0), generated fromdocs/v3/openapi3.yamlon frain-dev/convoy main. The hand-written SDK (rest ofsrc/, incl. webhook verify) is untouched by generation.sdk_generation.yamlmatches the frain-dev/convoy dispatcher contract (same workflow filename and inputs as the other SDK repos): regenerates, runs the test suite, then opens a PR only when the client changed.ci.ymladds GitHub Actions tests — this repo previously had no CI, so generation PRs would have had no gate.X-Convoy-Versionpin, JSON body, and that arbitrary eventdatapayloads round-trip without dropping keys.php ^8.1+ Guzzle for the generated client; the hand-written PSR-18 stack is unchanged.Test plan
composer test(pest) — 34 tests green (shared signature vectors + webhook + routes + 2 new contract tests)Note
Medium Risk
Large generated surface and a breaking PHP minimum (^8.1) plus new Guzzle dependency affect consumers; generation workflow has write/PR permissions but targets isolated branches with pre-PR tests.
Overview
Adds a generated
/api/v1client underConvoy\Client(src/Client/) from Convoy’s OpenAPI spec via pinned OpenAPI Generator 7.23.0 andscripts/generate.sh(checksum-verified JAR,rsyncintosrc/Client/only). The existing hand-written PSR-18 SDK and webhook code stay unchanged.Automation:
ci.ymlrunscomposer teston push/PR.sdk_generation.yamlregenerates on schedule/dispatch (aligned with other Convoy SDK repos), runs tests, and opens a PR only when the client diff is non-empty (validatedfeature_branch, optionalSDK_BOT_PAT).Package:
composer.jsonbumps minimum PHP to ^8.1 and adds Guzzle for the generated client. README documents the generated client usage and regeneration.Tests: New offline contract tests (Guzzle
MockHandler) assert verb, path, auth,X-Convoy-Version, JSON body, and eventdataround-trip for the generated client.Reviewed by Cursor Bugbot for commit e54783c. Bugbot is set up for automated code reviews on this repo. Configure here.