Skip to main content

Merge many files swagger specification into one file.

Project description

This library allows you to merge a many file swagger specification into a single one.

Quick start

For example, these two files:

# swagger.yml
/paths:
  /users: {$ref: grafts/users.yml#/resources/collection}

# grafts/users.yml
/resources:
  collection:
    get:
      200:
    post:
      201:

Will be merged as:

# swagger.yml
/paths:
  /users:
    get:
      200:
    post:
      201:

Wich can be used to validate your API against editor.swagger.io.

Installation

pip install swaggertools

Usage

As a command line:

swagger-tools /path/to/swagger.yml

Into python script:

from swaggertools import resolve

with open('/path/to/swagger.yml') as filehandler:
    app = resolve(filehandler)
print(app.to_yaml())

Project details


Download files

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

Files for swaggertools, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size swaggertools-0.0.4-py3-none-any.whl (8.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size swaggertools-0.0.4.tar.gz (20.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page