Skip to content

feat: add OpenAPI-generated API client - #1

Merged
mekilis merged 4 commits into
mainfrom
oksmart/openapi-generated-client
Jul 19, 2026
Merged

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

Conversation

@mekilis

@mekilis mekilis commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds the generated /api/v1 client via OpenAPI Generator (java, native library — JDK java.net.http + Jackson, pinned 7.23.0), following the same pattern as convoy-python: hand-written webhook verify is untouched, scripts/generate.sh mirrors only com.getconvoy.{api,client,models}.
  • Adds .github/workflows/sdk_generation.yaml matching the frain-dev/convoy dispatcher contract (filename + force/feature_branch inputs). It compiles and runs the test suite before opening a regen PR, and only opens a PR when generation produced a diff.
  • Bumps to 0.2.0 (additive: the client is new surface; verify API unchanged).
  • Tests: 17 shared-vector + 5 webhook tests unchanged and green; new EventDataRoundTripTest guards the open-map contract for event data (fix(controlplane): mark arbitrary-JSON object fields as open maps in OpenAPI spec convoy#2737); new EventsApiContractTest proves verb/path/auth/body offline against a local HTTP server. 25/25 green.

Known upstream wart (accepted): generated response decoding uses the JVM default charset. From JDK 18+ (JEP 400) that is UTF-8; patching generated files would churn on every regen.

Test plan

  • ./scripts/generate.sh runs locally and syncs only the three generated packages
  • ./gradlew test — 25/25 green on the Java 11 target

Note

Medium Risk
Very large generated public API and new runtime deps increase maintenance and semver surface; CI can force-push branches but is gated on tests and branch-name validation.

Overview
Adds an OpenAPI-generated Convoy API client alongside the existing hand-written webhook verifier, bumps the library to 0.2.0, and wires up repeatable regeneration.

scripts/generate.sh pulls Convoy’s openapi3.yaml, runs OpenAPI Generator (java, native / java.net.http, pinned 7.23.0), and rsyncs only com.getconvoy.{api,client,models} so com.getconvoy.webhook is never overwritten. Gradle gains Jackson/Jakarta dependencies for the generated code; README documents API usage and local regen.

.github/workflows/sdk_generation.yaml matches the other SDK repos’ dispatcher contract: weekly/dispatch regen from main, ./gradlew test before any PR, skip PR when there’s no diff, validated feature_branch, and optional SDK_BOT_PAT so PR CI can run.

The bulk of the diff is generated API/model sources (e.g. endpoints, events, deliveries) exposing the full Convoy HTTP surface to Java consumers.

Reviewed by Cursor Bugbot for commit 486cceb. Bugbot is set up for automated code reviews on this repo. Configure here.

mekilis added 3 commits July 19, 2026 22:37
openapi generator (java, native library, pinned 7.23.0) generates the
API client from convoy's docs/v3/openapi3.yaml. scripts/generate.sh
mirrors only com.getconvoy.{api,client,models}; the hand-written verify
package is never touched. sdk_generation.yaml matches the convoy
dispatcher contract (filename + force/feature_branch inputs) used by
convoy.js and convoy-python, and compiles + tests before opening a PR.
output of scripts/generate.sh against convoy main's openapi3.yaml.
event data fields are open maps (Map<String, Object>) and a round-trip
regression test guards against payload keys being dropped.
offline contract test proves verb, path, auth header, and JSON body for
createEndpointEvent against a local JDK http server. the regen workflow
now checks out main explicitly so a dispatch from another ref cannot
commit generated output onto the wrong base.

@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 dea19e6. Configure here.

Comment thread src/main/java/com/getconvoy/api/DeliveryAttemptsApi.java
Comment thread src/main/java/com/getconvoy/models/ModelsCreateEvent.java

@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

Performed an agentic security review on the current PR head and found two net-new security issues after deduplication and false-positive triage.

Open in Web View Automation 

Sent by Cursor Security Agent: Security Reviewer

Comment thread .github/workflows/sdk_generation.yaml Outdated
Comment thread src/main/java/com/getconvoy/api/DeliveryAttemptsApi.java
refs/heads/main would bypass the literal main check and force-push the
default branch. refs/* is now rejected like other protected shapes.

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

Completed security-orchestrator triage for current head 486cceb7cbb257919d9abcd4d59f1bfd9479b4d2.

Net-new unacknowledged finding: 1 (MEDIUM). Existing acknowledged/resolved automation threads were not reposted.

Open in Web View Automation 

Sent by Cursor Security Agent: Security Reviewer

Comment thread src/main/java/com/getconvoy/models/DatastoreOAuth2.java
@mekilis
mekilis merged commit 0f86b87 into main Jul 19, 2026
3 checks passed
@mekilis
mekilis deleted the oksmart/openapi-generated-client branch July 19, 2026 22:13
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