Skip to main content

Combine multiple Swagger files into a single YAML file.

Project description

Script Overview

Script Functionality

The script iterates through each YAML file in the specified input folder, combines their contents into a single Swagger definition, and saves it to the specified output file.

Combined Swagger Structure

The combined Swagger definition includes:

  • openapi: Version of the OpenAPI specification used (currently set to 3.0.0).
  • info: Information about the combined API.
  • servers: Server details.
  • paths: Endpoint paths and their operations.
  • components: Definitions of reusable components such as schemas, security schemes, and responses.
  • tags: Grouping of operations by tags.

How the Script Works

  • Argument Parsing: The script accepts two command-line arguments: input_folder and output_file.

Combining Swagger Files:

It iterates through each YAML file in the input folder. Merges server details, endpoint paths, components, and tags from each YAML file into the combined Swagger definition. Ensures the first server found is added to the combined Swagger.

Saving Combined Swagger:

The combined Swagger definition is saved to the output file in YAML format.

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

swagMerge-1.0.2.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file swagMerge-1.0.2.tar.gz.

File metadata

  • Download URL: swagMerge-1.0.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.1

File hashes

Hashes for swagMerge-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2e2e2e9ee7cd1ba5767fdb44081b677ec11f3e120df25a00bae3cd0333f3cf14
MD5 c6c663efef84684409af38d3127537c2
BLAKE2b-256 39df9b343458f7abe02a79f979ce88c769f0c6ac6a178bc752c2882994ab0adb

See more details on using hashes here.

Supported by

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