Skip to content

mcroissant/oas_patcher

Repository files navigation

OAS Patcher

A powerful command-line tool and Python library for working with OpenAPI Specification (OAS) Overlays. Modify and enhance your OpenAPI documents using a declarative overlay approach - no manual editing of large spec files needed!

Documentation PyPI version

Try it now: Online Demo

Key Features

🎯 Overlay System - Apply targeted modifications to OpenAPI documents
📦 Bundle Management - Organize multiple overlays into reusable bundles
🌍 Environment Support - Different configurations for dev, staging, production
🔧 Template Engine - Use variables and dynamic content with Jinja2
Validation - Comprehensive validation for overlays and configurations

View all features in documentation →

Quick Start

Installation

pip install oas-patch

Basic Usage

  1. Apply an Overlay
oas-patch overlay openapi.yaml overlay.yaml -o modified.yaml
  1. Generate an Overlay (Diff)
oas-patch diff original.yaml modified.yaml -o overlay.yaml
  1. Validate an Overlay
oas-patch validate overlay.yaml

Example

# overlay.yaml
overlay: 1.0.0
info:
  title: Production Environment Overlay
actions:
  - target: "$"
    update:
      servers:
        - url: https://api.production.com

Documentation

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