Skip to content

feat: add OpenAPI-generated API client#11

Merged
mekilis merged 3 commits into
mainfrom
oksmart/openapi-generated-client
Jul 20, 2026
Merged

feat: add OpenAPI-generated API client#11
mekilis merged 3 commits into
mainfrom
oksmart/openapi-generated-client

Conversation

@mekilis

@mekilis mekilis commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a generated /api/v1 client under src/Client/ (namespace Convoy\Client, mapped by the existing PSR-4 rule) via OpenAPI Generator (pinned 7.23.0), generated from docs/v3/openapi3.yaml on frain-dev/convoy main. 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 workflow filename and inputs as the other SDK repos): regenerates, runs the test suite, then opens a PR only when the client changed.
  • ci.yml adds GitHub Actions tests — this repo previously had no CI, so generation PRs would have had no gate.
  • Offline contract tests (Guzzle MockHandler) prove verb, path, auth header, X-Convoy-Version pin, JSON body, and that arbitrary event data payloads round-trip without dropping keys.
  • composer: 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/v1 client under Convoy\Client (src/Client/) from Convoy’s OpenAPI spec via pinned OpenAPI Generator 7.23.0 and scripts/generate.sh (checksum-verified JAR, rsync into src/Client/ only). The existing hand-written PSR-18 SDK and webhook code stay unchanged.

Automation: ci.yml runs composer test on push/PR. sdk_generation.yaml regenerates on schedule/dispatch (aligned with other Convoy SDK repos), runs tests, and opens a PR only when the client diff is non-empty (validated feature_branch, optional SDK_BOT_PAT).

Package: composer.json bumps 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 event data round-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.

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

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread src/Client/Api/EventsApi.php
Comment thread src/Client/Api/DeliveryAttemptsApi.php

@cursor cursor Bot 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.

Stale comment

Security review found 1 net-new actionable issue on the current head.

Open in Web View Automation 

Sent by Cursor Security Agent: Security Reviewer

Comment thread scripts/generate.sh
@mekilis
mekilis merged commit af0f20b into main Jul 20, 2026
3 checks passed
@mekilis
mekilis deleted the oksmart/openapi-generated-client branch July 20, 2026 05:14
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