Skip to main content

Create Connexion schema composed from several files in a nested directory structure.

Project description

Connexion Compose


Create Connexion schema composed from several files in a nested directory structure.

Resulting schema automatically includes common defaults, which you can use or override.

Requires Python 3.6+


pip install connexion-compose


from connexion_compose import compile_schema

spec_dir = 'some/dir'

schema = compile_schema(spec_dir)

The compile_schema function traverses the specification directory and all subdirectories, creating YAML attributes according to the directory structure. The bottom level files are "headers" and top level features, usually all contained in

For example, given the following directory structure:

├── 10-header.yml
├── 90-footer.yml
├── definitions
│   └── 50-whatever.yml
├── parameters
│   ├── 10-par1.yml
│   └── 20-par2.yml
└── x
    └── y
        └── z.yml

The resulting object will correspond to the following YAML input:

[contents of 10-header.yml]
[contents of 90-footer.yml]
  [contents of 50-whatever.yml]
  [contents of 10-par1.yml]
  [contents of 20-par2.yml]
    [contents of z.yml]


swagger: '2.0'
  contact: {name: Please add a contact name}
  description: Please add a description
  title: Please add a title
  version: 0.0.0
  x-visibility: unlisted
basePath: /
schemes: [https]
consumes: [application/json]
produces: [application/json]
  Currency: {format: iso_4217, type: string}
  Decimal: {format: decimal, type: string}
  Path: {format: path, type: string}
  Timestamp: {format: rfc_3339, type: string}
  URL: {format: url, type: string}
  UUID: {format: uuid, type: string}

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 connexion-compose, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size connexion-compose-0.2.0.tar.gz (4.3 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