Offline demo of mobile API contract selfchecks.
The template shows the same idea as the production api-tests project:
- Read a test config from
test-configs/*.yml. - Describe methods with
ApiMethodSpec. - Validate method contracts from
contracts/methods/*.yml. - Load fixed responses from local fixtures.
- Parse
data/errorsenvelope. - Validate payload as mobile DTOs expect it.
- Print console report and write markdown report.
No network, tokens, product URLs or real customer data are used.
Note: test-configs/default.yml includes base_url and pat_token_alias
for config parity with production. In this offline template they are placeholders
and are not used for network/auth calls.
mobile-api-selfcheck-template/
run_all.py
test-configs/default.yml
contracts/
methods/
chats/search.yml
feed/list.yml
dto/
chat.yml
feed_group.yml
fixtures/
domains/
selfcheck/
python3 run_all.py --test-config default --scenario ok --trace
python3 run_all.py --test-config default --scenario dto-fail --trace
python3 run_all.py --test-config default --scenario envelope-error --traceCustom report path:
python3 run_all.py --test-config default --scenario ok --report reports/ok.mdok— all fixtures match DTO validators.dto-fail— envelope is valid, but nested DTO validation fails.envelope-error— API returnserrorsinstead ofdata.
Chats:GET /api/chatswithlimit,offset,queryString.Feed:POST /api/feedwith simple body (limit,offset).
base_url— placeholder (https://yoursite.ru) for parity with real project config shape.pat_token_alias— placeholder alias (YOURSITE_PAT_TOKEN) for parity with PAT lookup flow.report.pathanddomains.*are used by the offline run.
See:
contracts/README.mdtest-configs/default.ymldocs/dto_chats.mddocs/dto_feed.mddocs/architecture.md