https://github.com/schemathesis/schemathesis
Supercharge your API testing, catch bugs, and ensure compliance
https://github.com/schemathesis/schemathesis
cli graphql hacktoberfest hypothesis openapi openapi3 property-based-testing pytest swagger testing
Last synced: about 16 hours ago
JSON representation
Supercharge your API testing, catch bugs, and ensure compliance
- Host: GitHub
- URL: https://github.com/schemathesis/schemathesis
- Owner: schemathesis
- License: mit
- Created: 2019-08-19T11:13:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-05-11T09:18:16.000Z (9 months ago)
- Last Synced: 2025-05-11T11:05:01.848Z (9 months ago)
- Topics: cli, graphql, hacktoberfest, hypothesis, openapi, openapi3, property-based-testing, pytest, swagger, testing
- Language: Python
- Homepage: https://schemathesis.readthedocs.io
- Size: 67 MB
- Stars: 2,494
- Watchers: 17
- Forks: 173
- Open Issues: 74
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-rest - Schemathesis - Property-based testing tool for web applications built with Open API and GraphQL specifications. (Testing / Querying)
- awesome-graphql - schemathesis - Runs arbitrary queries matching a GraphQL schema to find server errors. (Implementations / JavaScript/TypeScript)
- awesome-platform-engineering - Schemathesis - Specification-centric API testing tool for Open API and GraphQL-based applications (Application Security / API Fuzzing)
- awesome-python-resources - GitHub - 15% open · ⏱️ 25.08.2022): (测试)
- best-of-web-python - GitHub - 4% open · ⏱️ 06.11.2025): (Web Testing)
- awesome-learning - schemathesis
- fucking-awesome-graphql - schemathesis - Runs arbitrary queries matching a GraphQL schema to find server errors. (Implementations / JavaScript/TypeScript)
- awesome-integration - Schemathesis (⭐2.9k) - A Python library for property-based testing of API schemas, ensuring reliability through robust edge-case detection. (Projects / API Testing)
README
## Schemathesis
> **Catch API bugs before your users do.**
Schemathesis automatically generates thousands of test cases from your OpenAPI or GraphQL schema and finds edge cases that break your API.
Finding bugs that manual testing missed
## Try it now
```console
# Test a demo API - finds real bugs in 30 seconds
uvx schemathesis run https://example.schemathesis.io/openapi.json
# Test your own API
uvx schemathesis run https://your-api.com/openapi.json
```
## What problems does it solve?
- 💥 **500 errors** that crash your API on edge case inputs
- 📋 **Schema violations** where your API returns different data than documented
- 🚪 **Validation bypasses** where invalid data gets accepted
- 🔗 **Integration failures** when responses don't match client expectations
- 🔄 **Stateful bugs** where operations work individually but fail in realistic workflows
> ⚠️ **Upgrading from older versions?** Check our [Migration Guide](https://github.com/schemathesis/schemathesis/blob/master/MIGRATION.md) for key changes.
# Installation & Usage
**Command Line:**
```console
uv pip install schemathesis
schemathesis run https://your-api.com/openapi.json
```
**Python Tests:**
```python
import schemathesis
schema = schemathesis.openapi.from_url("https://your-api.com/openapi.json")
@schema.parametrize()
def test_api(case):
# Tests with random data, edge cases, and invalid inputs
case.call_and_validate()
# Stateful testing: Tests workflows like: create user -> get user -> delete user
APIWorkflow = schema.as_state_machine()
# Creates a test class for pytest/unittest
TestAPI = APIWorkflow.TestCase
```
**CI/CD:**
```yaml
- uses: schemathesis/action@v2
with:
schema: "https://your-api.com/openapi.json"
```
## Who uses it
Used by teams at **[Spotify](https://github.com/backstage/backstage)**, **[WordPress](https://github.com/WordPress/openverse)**, **JetBrains**, **Red Hat**, and dozens of other companies.
> "_Schemathesis is the best tool for fuzz testing of REST APIs on the market. We at Red Hat use it for examining our applications in functional and integration testing levels._" - Dmitry Misharov, RedHat
## See it in action
🔬 **[Live Benchmarks](https://workbench.schemathesis.io)** showing continuous testing results from real-world APIs:
- Code & API schema coverage achieved
- Issues found with detailed categorization
- Performance across different fuzzing strategies
## Documentation
📚 **[Documentation](https://schemathesis.readthedocs.io/en/stable/)** with guides, examples, and API reference.
## Get Help
- 💬 [Discord community](https://discord.gg/R9ASRAmHnA)
- 🐛 [GitHub issues](https://github.com/schemathesis/schemathesis/issues)
## Contributing
We welcome contributions! See our [contributing guidelines](CONTRIBUTING.md) and join discussions in [issues](https://github.com/schemathesis/schemathesis/issues) or [Discord](https://discord.gg/R9ASRAmHnA).
## Acknowledgements
Schemathesis is built on top of Hypothesis, a powerful property-based testing library for Python.
## License
This project is licensed under the terms of the [MIT license](https://opensource.org/licenses/MIT).