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.1.tar.gz (1.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: swagMerge-1.0.1.tar.gz
  • Upload date:
  • Size: 1.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.1.tar.gz
Algorithm Hash digest
SHA256 9b4ab1e2ec3c82090de05ef6cd582e431b55f37c8f703adc1c68af0e306753d4
MD5 55ac4a91c53b9fc30651426d1fbf3de1
BLAKE2b-256 7b7848bdee5a62dcbc2c45f74530385c49d526682c1b9d8015f7f57388c52c86

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