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: 7 days 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 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:47:56.000Z (6 months ago)
- Last Synced: 2024-10-29T09:57:44.028Z (6 months ago)
- Topics: cli, graphql, hacktoberfest, hypothesis, openapi, openapi3, property-based-testing, pytest, swagger, testing
- Language: Python
- Homepage: https://schemathesis.readthedocs.io
- Size: 63.9 MB
- Stars: 2,275
- Watchers: 21
- Forks: 163
- Open Issues: 62
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.py
- 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-integration - Schemathesis (⭐2.4k) - A Python library for property-based testing of API schemas, ensuring reliability through robust edge-case detection. (Projects / API Testing)
- best-of-web-python - GitHub - 9% open · ⏱️ 06.06.2024): (Web Testing)
- awesome-postman-alternatives - https://github.com/schemathesis/schemathesis
README
## Schemathesis
Schemathesis automatically generates and runs API tests from your OpenAPI or GraphQL schema to find bugs and spec violations.
![]()
Automatically finding specification violations and server errors> **Note:** This is the V4 branch under active development. While fully functional and passing tests, some features may be missing, and documentation is being updated. For the stable release, see the [V3 branch](https://github.com/schemathesis/schemathesis/tree/v3).
## Why Schemathesis?
- 📑 **Schema-Based Testing** - Transform API documentation into a comprehensive test suite
- 🚀 **Zero Configuration** - Begin testing immediately with a valid OpenAPI or GraphQL schema
- ⚙️ **CI-Ready** - Integrate API testing into existing pipelines without complex configuration
- 🛡️ **Effective Coverage** - Find edge cases no manual testing could uncover
- 🔬 **Research-Backed**: [Recognized](https://dl.acm.org/doi/10.1145/3617175) in [academic research](https://ieeexplore.ieee.org/document/9793781) as a state-of-the-art API testing tool## Installation
```console
# Using uv (recommended)
$ uv pip install schemathesis# Using pip
$ pip install schemathesis# Using Docker
$ docker pull schemathesis/schemathesis:stable
```## Usage
### Command Line
```console
# Run tests against a schema URL
$ st run https://example.schemathesis.io/openapi.json
```### Python Library
```python
import schemathesisschema = schemathesis.openapi.from_url("https://example.schemathesis.io/openapi.json")
@schema.parametrize()
def test_api(case):
case.call_and_validate()
```### CI/CD Integration
```yaml
# GitHub Actions example
steps:
- uses: schemathesis/action@v1
with:
schema: "https://example.schemathesis.io/openapi.json"
```## Documentation
📚 **[Read the full documentation](https://schemathesis.readthedocs.io/)** for guides, examples, and reference material.
## Who's Using Schemathesis?
Schemathesis is used by companies and open-source projects including:
- Netflix ([Dispatch](https://github.com/Netflix/dispatch))
- Spotify ([Backstage](https://github.com/backstage/backstage))
- WordPress ([OpenVerse](https://github.com/WordPress/openverse))
- Chronosphere.io ([Calyptia](https://github.com/chronosphereio/calyptia-api))
- [Qdrant](https://github.com/qdrant/qdrant)
- [Pixie](https://github.com/pixie-io/pixie)
- [CheckMK](https://github.com/Checkmk/checkmk)
- [Weechat](https://github.com/weechat/weechat)
- HXSecurity ([DongTai](https://github.com/HXSecurity/DongTai))
- Abstract Machines ([Magistrala](https://github.com/absmach/magistrala))
- Bundesstelle für Open Data ([smard-api](https://github.com/bundesAPI/smard-api))## Testimonials
"_The world needs modern, spec-based API tests, so we can deliver APIs as-designed. Schemathesis is the right tool for that job._"
Emmanuel Paraskakis - Level 250---
"_Schemathesis is the only sane way to thoroughly test an API._"
Zdenek Nemec - superface.ai---
"_The tool is amazing as it can test negative scenarios instead of me and much faster!_"
Luděk Nový - JetBrains---
"_Schemathesis is the best tool for fuzz testing of REST API on the market. We are at Red Hat use it for examining our applications in functional and integrations testing levels._"
Dmitry Misharov - RedHat---
"_There are different levels of usability and documentation quality among these tools which have been reported, where Schemathesis clearly stands out among the most user-friendly and industry-strength tools._"
Testing RESTful APIs: A Survey - a research paper by Golmohammadi, at al---
## Contributing
We welcome contributions! Your input directly influences Schemathesis development.
- Discuss ideas in [GitHub issues](https://github.com/schemathesis/schemathesis/issues) or our [Discord server](https://discord.gg/R9ASRAmHnA)
- See our [contributing guidelines](https://github.com/schemathesis/schemathesis/blob/master/CONTRIBUTING.rst) for code contributions
- Share your experience using [this feedback form](https://forms.gle/kJ4hSxc1Yp6Ga96t5)## Get in Touch
Need assistance with integration or have specific questions? Contact us at [email protected].
## 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).