Skip to main content

openapi-ext-tools

extended tools for openapi spec

bundle multiple yaml files into single openapi.yaml

$ openapi-spec-cli --help
usage: openapi-spec-cli [-h] --spec-path SPEC_PATH
                        [--bundled-spec-path BUNDLED_SPEC_PATH] [--verbose]

optional arguments:
  -h, --help            show this help message and exit
  --spec-path SPEC_PATH
                        set path to openapi spec file
  --bundled-spec-path BUNDLED_SPEC_PATH
                        set path to bundled spec file
  --verbose             set verbose mode

How to use

Currently, bundling only support components object.

The tests/fixtures/simple/openapi.yaml is openapi specification file and a part of schemas is defined in tests/fixtures/simple/schemas.yaml.

...
    content:
      application/json:
        schema:
          $ref: 'schemas.yaml#/components/schemas/User'
...

For example, User schema is defined like this.

components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
          format: int64
        username:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        birthday:
          type: string
          format: date
        email:
          type: string
        password:
          type: string
        phone:
          type: string
        userStatus:
          type: integer
          description: User Status
          format: int32

Run openapi-spec-cli to bundle yaml files and create single openapi.yaml.

$ openapi-spec-cli --spec-path tests/fixtures/simple/openapi.yaml
2019-05-11 11:56:12,337 openapi.spec.ext INFO wrote bundled spec file to "bundled_openapi.yaml"
2019-05-11 11:56:12,402 openapi.spec.ext INFO validating bundled spec: OK

You can confirm bundled_openapi.yaml in current directory. Then, all schemas in schemas.yaml are moved to bundled_openapi.yaml and a $ref field also reffers as Local Reference.

...
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/User'
...

Metadata

Release files for openapi-ext-tools 0.5.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 openapi-ext-tools 0.5.1
File Size Uploaded Provenance
openapi-ext-tools-0.5.1.tar.gz 12.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for openapi-ext-tools 0.5.1
File Interpreter ABI Platform
openapi_ext_tools-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / openapi-ext-tools-0.5.1.tar.gz

Download URL openapi-ext-tools-0.5.1.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d559128ded1d28d8a49e8a42189b0932807f74966bde331600f11890f3f5d487
BLAKE2b-256 checksum
How to use checksums
87a7ba2d6ed13f4b187ea91504d65af69af2424fbc9d01dc5bcf4fc17287ac71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.5

Release files / openapi_ext_tools-0.5.1-py3-none-any.whl

Download URL openapi_ext_tools-0.5.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6ab3bbb4e90c49bb7bb9afef29c687cf8620caabd93a9a1c664139596dff4ad
BLAKE2b-256 checksum
How to use checksums
510cfd994c137416d0554093473598a0efd934674db534eb405120ea3e1df0cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.5

Security for openapi-ext-tools 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files No provenance

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