# API schema & contract tests

A step of the [Cloud application](https://gradus.kazet.blog/tree/cloud-application) tree on Gradus, in the Testing & resilience area: Tests, errors, SLOs.

Page: https://gradus.kazet.blog/tree/cloud-application/step/api-contract-tests

Publish an API schema and test that the implementation honours it, so clients can trust the contract.

Usually comes after: [Test doubles & fixtures](https://gradus.kazet.blog/tree/cloud-application/step/test-doubles).

## Prompt for your AI assistant

```
Define an OpenAPI schema for this API, validate responses against it in tests and add a contract test that fails when the implementation drifts from the schema.
```

Every step of the tree: https://gradus.kazet.blog/tree/cloud-application/llms.txt
