zsl_openapi

Generate OpenAPI specification out of your ZSL service.


License
BSD-3-Clause
Install
pip install zsl_openapi==0.2.0

Documentation

Overview

docs Documentation Status
tests
Travis-CI Build Status
Coverage Status Coverage Status
package

Generate OpenAPI specification for your models and API out of your ZSL service. This module scans the given packages for the persistent models and generates model definitions out of them.

Also the tasks (not methods) are scanned and their documentation is generated. The other API (paths) may be declared manually. To use create an empty openapi_spec.yml which is first read and enriched by the model and task API documentation.

  • Free software: BSD license

Installation

pip install zsl-openapi

How to use

Define container with the zsl_openapi.module.OpenAPIModule.

class MyContainer(WebContainer):
    open_api = OpenAPIModule

Then you may use CLI open_api command.

python app.py \
    open_api generate \
    --package storage.models.persistent \
    --output api/openapi_spec_full.yml \
    --description api/openapi_spec.yml

See more in the documentation mentioned below.

Documentation

https://zsl_openapi.readthedocs.io/

Development

Setup a virtualenv using Python 2.7 and activate it. To install all the development requirements run:

pip install -r requirements.txt

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox