Skip to main content

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

Overlay Spec

Key Features

🎯 Overlay System - Apply targeted modifications to OpenAPI documents
📋 Copy Action - Duplicate schemas and components within your API (Overlay 1.1)
📦 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

Supports OpenAPI Overlay Specification 1.0 and 1.1 - Use the latest features or maintain backward compatibility.

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.1.0
info:
  title: Production Environment Overlay
  version: 1.0.0
  description: Configures the API for production use
actions:
  # Update server URL

  - target: "$"
    update:
      servers:
        - url: https://api.production.com
  
  # Copy a schema to create a new one (Overlay 1.1 feature)
  - target: "$.components.schemas.AdminUser"
    copy: "$.components.schemas.User"
    description: Create AdminUser schema based on User schema

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.

Metadata

Release files for oas-patch 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oas-patch 0.6.0
File Size Uploaded
oas_patch-0.6.0.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oas-patch 0.6.0
File Interpreter ABI Platform
oas_patch-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.1 kB

Release files / oas_patch-0.6.0.tar.gz

Download URL oas_patch-0.6.0.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f869196a459ad8552598c62aa1a89295fc828e847016ed466a3b1026a00ce4ee
BLAKE2b-256 checksum
How to use checksums
60189087789961394ed0c16986a9b06f98c931f15eac80404b38fa60e069ec00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / oas_patch-0.6.0-py3-none-any.whl

Download URL oas_patch-0.6.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a84222de2493d11a8384d4530e8fce28c153b75f4d87471699b3d5ab51e74fa
BLAKE2b-256 checksum
How to use checksums
94b69baf33d015899d5576a34c3a9abc91e9b23153e58252ac04a99586f04b63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.6

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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