Org Web Adapter

hungryroot/jira/be_7835_schemathesis_contract_testing.org

ID
f353637a-3e5d-4b03-833a-61af8964acdb

BE-7835 Scaffold Schemathesis OpenAPI contract-testing harness

- source :: https://hungryroot.atlassian.net/browse/BE-7835

- tags :: Hungryroot API Project

- status :: Development in Progress

Summary

Phase 1 (Schemathesis) of contract testing proposal. Validate drf-spectacular

OpenAPI schema against implementation, in-process (no live server), via Django/DRF test client.

Scope

- Add ~schemathesis~ to ~pyproject.toml~ ~[project.optional-dependencies].dev~

- Create ~app/tests/rest/contract/~ package

- Load drf-spectacular schema in-process for ~/api/v2/~ and ~/api/v3/~

- Schema served at ~/api/v2/schema/~ and ~/api/v3/schema/~

- Generate directly, no running server

- Drive property-based request/response validation through DRF ~APIClient~

Acceptance Criteria

- [ ] Harness runs locally, validates at least one endpoint against schema

- [ ] Reports schema conformance failures clearly

- [ ] ~prek run ruff~ and ~prek run ruff-format~ clean on touched files

Tasks

TODO Add schemathesis to pyproject.toml dev deps :work:hungryroot:project:contract-testing:be7835:

TODO Create app/tests/rest/contract/ package :work:hungryroot:project:contract-testing:be7835:

TODO Load drf-spectacular schema in-process for v2 and v3 :work:hungryroot:project:contract-testing:be7835:

TODO Wire up APIClient-driven property-based validation :work:hungryroot:project:contract-testing:be7835:

TODO Verify ruff/ruff-format clean :work:hungryroot:project:contract-testing:be7835: