Skip to main content

Swaggertest

This is a very simple tool which tests swagger (OpenAPI) specifications. In particular, it checks the schemas provided in the 'components/schemas' section of the document against any examples provided along with the schemas.

Installation

$ pip install swaggertest

Usage

$ swaggertest --help
usage: swaggertest [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
[--pdb]

Swagger testing tool

optional arguments:
  --version            show program's version number and exit
  -v, --verbose        Increase verbosity of output. Can be repeated.
  -q, --quiet          Suppress output except warnings and errors.
  --log-file LOG_FILE  Specify a file to log output. Disabled by default.
  -h, --help           Show help message and exit.
  --debug              Show tracebacks on errors.
  --pdb

Commands:
  complete       print bash completion command (cliff)
  help           print detailed help for another command (cliff)
  test-schemas   Validate examples against schemas

The main sub-command is test-schemas:

$ swaggertest help test-schemas
usage: swaggertest test-schemas [-h] [-d] [-p PATH] [-s] filename

Validate examples against schemas

positional arguments:
  filename

optional arguments:
  -h, --help            show this help message and exit
  -d, --detail
  -p PATH, --path PATH  Path to where the schemas are located
  -s, --strict          Default to 'allowExtraProperties: false'

To test a spec, just provide it as the filename argument. You can also provide a path argument to specify where the schemas are to be found:

$ swaggertest test petstore.json --path '/definitions' --detail --strict
Validated 6 schemas:
  - 0 had errors

Metadata

Release files for swaggertest 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swaggertest 0.1.1
File Size Uploaded
swaggertest-0.1.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swaggertest 0.1.1
File Interpreter ABI Platform
swaggertest-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / swaggertest-0.1.1.tar.gz

Download URL swaggertest-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
387c251e323e19daf80d3e0599f8d43c1e6032c1be96d9edc41e6bc8eb8359b0
BLAKE2b-256 checksum
How to use checksums
e1159c842bf962fac38bef86f0d992ea193b45c21b33ea3d2eddac3627593857
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release files / swaggertest-0.1.1-py3-none-any.whl

Download URL swaggertest-0.1.1-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff2f9d40b82be796546650df0816606be3d8baeea064c07194f0a180fc8f6b34
BLAKE2b-256 checksum
How to use checksums
bbe2d20e5e018c77b9e20da3ee270485672235672d26887ff314711f76502c08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page