Roboswag
Introduction
🤖 Roboswag is a tool that automatically generates Python libraries out of your Swagger (OpenAPI specification file). These libraries can be used to create tests with various payload content and its validation. It also supports response validation against schema and verification of different status codes.
Note
The tool is in the Alpha state, which means it may be unstable and should be used at your own risk. Some features may be broken and there are still many things to be developed. Happy testing!
The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs. Click here for v3 documentation and here for v2 documentation.
Hosted on GitHub. 🎖️
Installation
Note
The PyPI package will be released when Beta version is out.
First, you need to install Roboswag, and there are currently 2 ways to do it:
- you can clone the repository, go to the main
roboswagdirectory and install the tool locally:
pip install .
- you can install the tool directly from GitHub's source code:
pip install -U git+https://github.com/MarketSquare/roboswag.git
Usage
Roboswag can be easily run from command line. To check if it's installed, run this to see the current version:
roboswag -v
To execute Roboswag with its full capabilities, run it with provided path to the Swagger (OpenAPI specification) file:
roboswag generate -s <path_to_swagger>
You can try out the tool using the example of swagger file located in
swaggers/petstore.json.
Successful execution should result in printing the information about generated files and a whole new directory (named
by the value of info.title from your Swagger file) consisting of:
endpointsdirectory with files representing eachtagas a class with methods representing its endpoints,modelsdirectory with API models represented as Python classes,schemasdirectory with every possible schema from your API as JSON file used for validating payload and responses.
Now you can just create a test file, import desired endpoint and start automating the testing!
Limitations
The tool is already able to generate libraries but...
- Not all fields from the swagger specification may be supported. This means that a specific file may break the tool and flood the terminal with stack trace (we will be really grateful to receive bug issues in our Github project!)
- Authorization to access the API is not yet fully covered
- There is not much to be configured here - it always works the same
- There is no real documentation apart from this file
Please be forgiving and submit an issue, if you struggle with something or just contact us on our Slack channel. It's more than welcome also to support us by code contribution! ⌨️
Metadata
Release files for roboswag 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| roboswag-0.4.0.tar.gz | 17.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| roboswag-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.0 kB
Release files / roboswag-0.4.0.tar.gz
| Download URL | roboswag-0.4.0.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73baef55e563af30b4a491c2f288644e4f025010b9013caa7bdc0550f68f7430
|
|
BLAKE2b-256 checksum How to use checksums |
6a1efbe36884cc8b4f3da384e96a2ed98afac708678a11ecce94f2bf2a34666b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.15 CPython/3.10.6 Linux/5.15.0-1017-azure
|
Release files / roboswag-0.4.0-py3-none-any.whl
| Download URL | roboswag-0.4.0-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8c005c7c0c62162400ee5df264305930c516a270ecb4e4787f96e8cffe076a9
|
|
BLAKE2b-256 checksum How to use checksums |
2a246d3c33bbabffeac597c1d9f26678051dd68643901b44eaa51e252865672c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.15 CPython/3.10.6 Linux/5.15.0-1017-azure
|
Security for roboswag 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.