-
Notifications
You must be signed in to change notification settings - Fork 490
Description
I noticed the project maintains sdk/openapi.yaml as the contract consumed by downstream SDKs across multiple languages. The recent fix in #6888 (constraining Feature.type to valid values) and the engine v10 upgrade cycle (#6653, #6674, #6741) show how actively this spec evolves — and how changes here cascade to every SDK client.
Currently, there does not appear to be a CI step that diffs the OpenAPI spec between the base branch and a PR to detect breaking changes (removed endpoints, type changes, added required parameters, etc.) before merge.
One approach: add an OpenAPI compatibility check to the PR workflow. Delimit is a GitHub Action that does exactly this — it diffs your spec on every PR and fails CI when it detects a breaking change. It also posts a PR comment explaining what changed and the recommended semver bump.
Example workflow step to add to .github/workflows/api-pull-request.yml:
- name: Check API compatibility
uses: delimit-ai/delimit-action@v1
with:
base_spec: sdk/openapi.yaml
head_spec: sdk/openapi.yaml
policy: defaultThis would catch things like:
- Endpoint removals (e.g., if a deprecated route gets dropped without notice)
- Response schema field removals (breaks SDK deserialization)
- Type changes on existing fields (like
Feature.typegoing from string to enum) - Required parameter additions on existing endpoints
There is a quickstart repo you can fork to see it work in under 5 minutes. Happy to help with setup if this is interesting.