Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 13 hours ago
JSON representation

Supercharge your API testing, catch bugs, and ensure compliance

Awesome Lists containing this project

README

        



Build


Coverage


Version


Python versions


Discord


License

## Schemathesis

> ⚠️ You are viewing the Schemathesis V4 README (Work in Progress) ⚠️

> This branch is under active development, with substantial changes expected before stabilization. While V4 is fully functional and passing tests, some features are missing, and the documentation may be outdated.

> For the stable release, see the [V3 branch](https://github.com/schemathesis/schemathesis/tree/v3).

> 💡 Have feedback? Share your thoughts in [this discussion](https://github.com/schemathesis/schemathesis/discussions/2677)!

Schemathesis is an API testing tool that automatically finds crashes and validates spec compliance.


Schemathesis Demo


Finding server crashes in the Demo API.

### Highlights

🎯 **Catches Hard-to-Find Bugs**

- Uncover hidden crashes and edge cases that manual testing might miss
- Identify spec violations and ensure your API adheres to its contract

⚡ **Accelerates Testing Cycles**

- Automatically generate a wide range of test cases based on your API schema
- Save time by reducing the need for manual test case creation

🧩 **Integrates Seamlessly**

- Works with popular API formats such as OpenAPI, GraphQL.
- Easily integrate into your existing CI/CD workflows.

🔧 **Customizable and Extendable**

- Tune the testing process using Python extensions.
- Adjust the testing flow to suit your needs with rich configuration options.

🐞 **Simplifies Debugging**

- Get detailed reports to identify and fix issues quickly.
- Reproduce failing test cases with cURL commands.

🔬 **Proven by Research**

- Validated through academic studies on API testing automation
- Featured in [ICSE 2022 paper](https://ieeexplore.ieee.org/document/9793781) on semantics-aware fuzzing
- Recognized in [ACM survey](https://dl.acm.org/doi/10.1145/3617175) as state-of-the-art RESTful API testing tool

## Installation

Use Schemathesis via Docker, or install it from [PyPI](https://pypi.org/project/schemathesis/)

```console
# Via Docker.
$ docker pull schemathesis/schemathesis:stable

# With pip.
$ pip install schemathesis
```

## Getting Started

Schemathesis works as a standalone CLI:

```console
docker run schemathesis/schemathesis:stable
run --checks all https://example.schemathesis.io/openapi.json
# Or when installed with pip
schemathesis run --checks all https://example.schemathesis.io/openapi.json
```

Or a Python library:

```python
import schemathesis

schema = schemathesis.openapi.from_url("https://example.schemathesis.io/openapi.json")

@schema.parametrize()
def test_api(case):
case.call_and_validate()
```

See a complete working example project in the [/example](https://github.com/schemathesis/schemathesis/tree/master/example) directory.

Schemathesis can be easily integrated into your CI/CD pipeline using GitHub Actions. Add this block to your GitHub Actions to run Schemathesis against your API:

```yaml
api-tests:
runs-on: ubuntu-latest
steps:
- uses: schemathesis/action@v1
with:
schema: "https://example.schemathesis.io/openapi.json"
```

For more details, check out our [GitHub Action](https://github.com/schemathesis/action) repository or see our [GitHub Tutorial](https://docs.schemathesis.io/tutorials/github).

## Who's Using Schemathesis?

Schemathesis is used by a number of projects and companies, including direct usage or integration into other tools:

- Abstract Machines ([Magistrala](https://github.com/absmach/magistrala))
- Bundesstelle für Open Data ([smard-api](https://github.com/bundesAPI/smard-api))
- [CheckMK](https://github.com/Checkmk/checkmk)
- Chronosphere.io ([Calyptia](https://github.com/chronosphereio/calyptia-api))
- HXSecurity ([DongTai](https://github.com/HXSecurity/DongTai))
- Netflix ([Dispatch](https://github.com/Netflix/dispatch))
- [Pixie](https://github.com/pixie-io/pixie)
- [Qdrant](https://github.com/qdrant/qdrant)
- Spotify ([Backstage](https://github.com/backstage/backstage))
- [Weechat](https://github.com/weechat/weechat)
- WordPress ([OpenVerse](https://github.com/WordPress/openverse))

## 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 absolutely amazing as it can do the negative scenario testing instead of me and much faster! Before I was doing the same tests in Postman client. But it's much slower and brings maintenance burden._"

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 in code and are especially interested in learning about your use cases. Your input is essential for improving Schemathesis and directly influences future updates.

### How to Contribute

1. Discuss ideas and questions through [GitHub issues](https://github.com/schemathesis/schemathesis/issues) or on our [Discord channel](https://discord.gg/R9ASRAmHnA).
2. For code contributions, see our [contributing guidelines](https://github.com/schemathesis/schemathesis/blob/master/CONTRIBUTING.rst).
3. Share your experience and thoughts using [this feedback form](https://forms.gle/kJ4hSxc1Yp6Ga96t5).

### Why Your Input Matters

- Enables us to develop useful features and fix bugs faster
- Improves our test suite and documentation

Thank you for contributing to making Schemathesis better! 👍

## Get in Touch

If you need assistance with integrating Schemathesis into your workflows or have specific questions, feel free to reach out 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).