Skip to content

test(ads-client): add OpenAPI schema contract tests against MARS spec#7276

Draft
Almaju wants to merge 1 commit intomozilla:mainfrom
Almaju:ads-client-openapi-schema-tests
Draft

test(ads-client): add OpenAPI schema contract tests against MARS spec#7276
Almaju wants to merge 1 commit intomozilla:mainfrom
Almaju:ads-client-openapi-schema-tests

Conversation

@Almaju
Copy link
Contributor

@Almaju Almaju commented Mar 18, 2026

Summary

  • Adds openapi.json snapshot of the MARS API spec
  • Adds unit contract tests in ad_request.rs and ad_response.rs that validate our serialized types against the schema (runs on every cargo test, zero network cost)
  • Explicitly documents intentional deviations: click/impression callbacks are optional in spec but required by us; attributions field is not modelled and silently ignored

Split from #7263

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@Almaju Almaju changed the title feat(ads-client): add OpenAPI schema contract tests against MARS spec test(ads-client): add OpenAPI schema contract tests against MARS spec Mar 18, 2026
@Almaju Almaju marked this pull request as draft March 18, 2026 21:14
@Almaju Almaju force-pushed the ads-client-openapi-schema-tests branch from db0aa52 to 844a4ea Compare March 18, 2026 21:25
Add openapi.json snapshot of the MARS spec and unit contract tests in
ad_request.rs and ad_response.rs that validate our serialized types against
the schema. Tests run on every cargo test invocation at zero network cost.

Deviations from the spec are explicitly documented (click/impression callbacks
are optional in spec but required by us; attributions field is not modelled
and silently ignored).
@Almaju Almaju force-pushed the ads-client-openapi-schema-tests branch from 844a4ea to febc94a Compare March 18, 2026 21:30
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