Skip to main content

A complete cli/lib to apply overlays to OpenAPI documents, powering your ci/cd and API lifecycle

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oas_patch-0.6.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oas_patch-0.6.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file oas_patch-0.6.0.tar.gz.

File metadata

  • Download URL: oas_patch-0.6.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for oas_patch-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f869196a459ad8552598c62aa1a89295fc828e847016ed466a3b1026a00ce4ee
MD5 0f7088808698b7f2286d941e44259ba9
BLAKE2b-256 60189087789961394ed0c16986a9b06f98c931f15eac80404b38fa60e069ec00

See more details on using hashes here.

File details

Details for the file oas_patch-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: oas_patch-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for oas_patch-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a84222de2493d11a8384d4530e8fce28c153b75f4d87471699b3d5ab51e74fa
MD5 4f7d1f35cbc7e78c2d28b3a865967070
BLAKE2b-256 94b69baf33d015899d5576a34c3a9abc91e9b23153e58252ac04a99586f04b63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page