Skip to main content

Test your swagger spec

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swaggertest-0.1.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

swaggertest-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file swaggertest-0.1.1.tar.gz.

File metadata

  • Download URL: swaggertest-0.1.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for swaggertest-0.1.1.tar.gz
Algorithm Hash digest
SHA256 387c251e323e19daf80d3e0599f8d43c1e6032c1be96d9edc41e6bc8eb8359b0
MD5 189ca17932a2ba356592e1bc2fb83f49
BLAKE2b-256 e1159c842bf962fac38bef86f0d992ea193b45c21b33ea3d2eddac3627593857

See more details on using hashes here.

File details

Details for the file swaggertest-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: swaggertest-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for swaggertest-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff2f9d40b82be796546650df0816606be3d8baeea064c07194f0a180fc8f6b34
MD5 3d1d7c68cb1d3cb2a8a64e0cb9f2f51e
BLAKE2b-256 bbe2d20e5e018c77b9e20da3ee270485672235672d26887ff314711f76502c08

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page