Skip to content

Add OpenAPI "drift detecting" test - #134

Merged
Kostis-S-Z merged 28 commits into
mainfrom
openapi-spec-test
Sep 15, 2026
Merged

Kostis-S-Z merged 28 commits into
mainfrom
openapi-spec-test

Conversation

@Kostis-S-Z

@Kostis-S-Z Kostis-S-Z commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Add a daily CI action that:

  1. pulls the latest OpenAPI spec from the platform
  2. runs the test to detect drifts of the API contract between the SDK and the platform
  3. if drift is detected it opens a PR with the result in the body

The actual tests/test_openapi_contract.py reads the openapi spec and checks that:

  • every endpoint the SDK calls exists with the same method
  • the Task and Visibility enums match what the update request accepts
  • the draft, update and submit payloads match the request schemas (update and submit in both directions, so a field the platform accepts but the SDK cannot set fails too)
  • every field on DatasetDetails exists in the dataset response, and every field on DatasetSubmission is either returned on a submission or accepted on PATCH
  • the upload and download payloads match, and the response keys the SDK relies on are marked required.

When the spec and the SDK disagree, the test will be red until the SDK model is fixed.
Can also use MDC_OPENAPI_SPEC to point it at a different spec (file or URL)

@Kostis-S-Z
Kostis-S-Z marked this pull request as ready for review September 11, 2026 14:32
@Kostis-S-Z
Kostis-S-Z merged commit b7e0e9b into main Sep 15, 2026
3 checks passed
@Kostis-S-Z
Kostis-S-Z deleted the openapi-spec-test branch September 15, 2026 16:22
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