Skip to main content
Travis status

swagger-aggregator

Swagger-aggregator allow you to create a swagger REST API from several other swagger REST APIs.

This can be really useful if you want to make an API Gateway accessing some of your internal APIs. You can also filter which path you want to deliver, and which properties of your definitions you don’t want to show.

Example Usage

Here is an example of an aggregate configuration.

args: pet_url

info:
  version: "0.1"
  title: "API Gateway"

basePath: /v2

apis:
    pet: http://pet_url/v2

exclude_paths:
  - DELETE /pets/{petId}

exclude_fields:
  petPet:
    - id

This is not the most useful aggregation, as it only aggregate one API. The first part, args, define that the first parameter we will send to the aggregate will be pet_url. Then pet_url will be replaced by the given value everywhere in the config. The two next part, info and basePath, are the same as the ones you can find in every swagger API. apis, define the different APIs you want to aggregate. A name is associated with it URL. Then exclude_paths allow you to not deliver some path. In this case we don’t want the user to delete a pet.

Finally, exclude_fields define the attributes of the definitions we do not want to show. The value of the keys is the name of the API followed by the name of the definition. The value of each key will be a list of all properties to exclude.

Then use this command to generate the aggregated swagger file:

from traxit_aggregator import SwaggerAggregator

SwaggerAggregator('config.yaml', 'pet.com')

Documentation

More documentation is available at https://swagger-aggregator.readthedocs.org/en/latest/.

Setup

make install or pip install swagger-aggregator

License

swagger-aggregator is licensed under http://opensource.org/licenses/MIT.

History

0.1.1 (2016-1-31)

  • Change license to MIT.

0.1 (2016-1-29)

  • First release on PyPI.

Release files for swagger-aggregator 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 swagger-aggregator 0.1.1
File Size Uploaded
swagger_aggregator-0.1.1.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swagger-aggregator 0.1.1
File Interpreter ABI Platform
swagger_aggregator-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 25.7 kB

Release files / swagger_aggregator-0.1.1.tar.gz

Download URL swagger_aggregator-0.1.1.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0476f6be8e73654326affb7876f1e8a22de5058b2cc0145088edf021453105a6
BLAKE2b-256 checksum
How to use checksums
db89bae159e9f5b2dee0ae72fa630f33b2425eacac27e83375f5ad45f5c7db2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / swagger_aggregator-0.1.1-py2.py3-none-any.whl

Download URL swagger_aggregator-0.1.1-py2.py3-none-any.whl
Size 8.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f26c1fe417a3edd2c4cfae82af8e71c9b6e8c00fda441d179d75c9fdb7365e39
BLAKE2b-256 checksum
How to use checksums
f17e4f2d1ab5222397e07daa0587b9c4d65383cc602a87ccb1f8947126a0ed5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

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