Skip to content

Command-line utility that allows you to programmatically modify or update OpenAPI specifications

License

Notifications You must be signed in to change notification settings

mcroissant/oas_patcher

Repository files navigation

OAS Patcher

A command-line tool for working with OpenAPI Specification (OAS) Overlays, allowing you to patch and modify OpenAPI documents.

NOTE try it now : Online Demo

Features

  • Apply OpenAPI Overlays to existing OpenAPI documents
  • Generate overlay files by comparing two OpenAPI documents
  • Validate OpenAPI Overlay documents against the specification

Installation

pip install oas-patcher

Usage

Apply an Overlay

Apply changes from an overlay file to an OpenAPI document:

oas-patcher overlay openapi.yaml overlay.yaml -o modified.yaml

Options:

  • -o, --output: Path to save the modified OpenAPI document (optional, defaults to stdout)
  • --sanitize: Remove special characters from the OpenAPI document

Generate an Overlay (Diff)

Create an overlay file by comparing two OpenAPI documents:

oas-patcher diff original.yaml modified.yaml -o overlay.yaml

Options:

  • -o, --output: Path to save the generated overlay file (optional, defaults to stdout)

Validate an Overlay

Validate an OpenAPI Overlay document against the specification:

oas-patcher validate overlay.yaml --format yaml

Options:

  • --format: Output format for validation results (choices: sh, log, yaml; default: sh)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Command-line utility that allows you to programmatically modify or update OpenAPI specifications

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages