Metadata-Version: 2.4
Name: oas_patch
Version: 0.6.0
Summary: A complete cli/lib to apply overlays to OpenAPI documents, powering your ci/cd and API lifecycle
Home-page: https://github.com/mcroissant/oas_patcher
Author: Matthieu Croissant
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML>=6.0
Requires-Dist: jsonpath-ng>=1.7.0
Requires-Dist: jsonschema>=4.23.0
Requires-Dist: deepdiff>=8.4.2
Requires-Dist: Jinja2>=3.1.0
Requires-Dist: rich>=13.0.0
Requires-Dist: click>=8.0.0
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

# 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](https://img.shields.io/badge/docs-online-blue)](https://mcroissant.github.io/oas_patcher/)
[![PyPI version](https://badge.fury.io/py/oas-patch.svg)](https://badge.fury.io/py/oas-patch)

[![Overlay Spec](https://img.shields.io/badge/Overlay-1.0%20%7C%201.1-green)](https://github.com/OAI/Overlay-Specification)

## 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 →](https://mcroissant.github.io/oas_patcher/core-concepts/overlays/)

## Quick Start

### Installation

```bash
pip install oas-patch
```

### Basic Usage

1. **Apply an Overlay**
```bash
oas-patch overlay openapi.yaml overlay.yaml -o modified.yaml
```

2. **Generate an Overlay (Diff)**
```bash
oas-patch diff original.yaml modified.yaml -o overlay.yaml
```

3. **Validate an Overlay**
```bash
oas-patch validate overlay.yaml
```

## Example

```yaml
# 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

- 📚 [Full Documentation](https://mcroissant.github.io/oas_patcher/)
- 🚀 [Getting Started Guide](https://mcroissant.github.io/oas_patcher/getting-started/quick-start/)
- 💡 [Core Concepts](https://mcroissant.github.io/oas_patcher/core-concepts/overlays/)

## Contributing

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

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
