@@ -30,13 +30,18 @@ OpenAPI Overlays provide a way to modify OpenAPI and Arazzo specifications witho
3030Apply an overlay to an OpenAPI specification.
3131
3232``` bash
33- # Apply overlay to a specification
33+ # Apply overlay to a specification (positional arguments)
34+ openapi overlay apply overlay.yaml spec.yaml
35+
36+ # Apply overlay to a specification (flags)
3437openapi overlay apply --overlay overlay.yaml --schema spec.yaml
3538
3639# Apply overlay with output to file
3740openapi overlay apply --overlay overlay.yaml --schema spec.yaml --out modified-spec.yaml
3841
3942# Apply overlay when overlay has extends key set
43+ openapi overlay apply overlay.yaml
44+ # or
4045openapi overlay apply --overlay overlay.yaml
4146```
4247
@@ -46,17 +51,21 @@ Features:
4651- Supports all OpenAPI Overlay Specification operations
4752- Handles complex nested modifications
4853- Preserves original document structure where not modified
54+ - Supports both positional arguments and explicit flags
4955
5056### ` validate `
5157
5258Validate an overlay file for compliance with the OpenAPI Overlay Specification.
5359
5460``` bash
55- # Validate an overlay file
61+ # Validate an overlay file (positional argument)
62+ openapi overlay validate overlay.yaml
63+
64+ # Validate an overlay file (flag)
5665openapi overlay validate --overlay overlay.yaml
5766
5867# Validate with verbose output
59- openapi overlay validate -v --overlay overlay.yaml
68+ openapi overlay validate -v overlay.yaml
6069```
6170
6271This command checks for:
@@ -73,11 +82,14 @@ Note: This validates the overlay file structure itself, not whether it will appl
7382Generate an OpenAPI Overlay specification from two input files.
7483
7584``` bash
76- # Generate overlay from two specifications
77- openapi overlay compare --before spec1.yaml --after spec2.yaml --out overlay .yaml
85+ # Generate overlay from two specifications (positional arguments)
86+ openapi overlay compare spec1.yaml spec2.yaml
7887
79- # Generate overlay with console output
88+ # Generate overlay from two specifications (flags)
8089openapi overlay compare --before spec1.yaml --after spec2.yaml
90+
91+ # Generate overlay with output to file
92+ openapi overlay compare --before spec1.yaml --after spec2.yaml --out overlay.yaml
8193```
8294
8395Features:
@@ -86,6 +98,7 @@ Features:
8698- Generates overlay operations for all changes
8799- Provides diagnostic output showing detected changes
88100- Creates overlay files that can recreate the transformation
101+ - Supports both positional arguments and explicit flags
89102
90103### ` upgrade `
91104
@@ -172,9 +185,24 @@ All commands support these common options:
172185
173186- ` -h, --help`: Show help for the command
174187- `-v, --verbose` : Enable verbose output (global flag)
175- - `--overlay` : Path to the overlay file
176- - `--schema` : Path to the OpenAPI specification (for apply command)
177- - `--out` : Output file path (optional, defaults to stdout)
188+
189+ Command-specific flags :
190+
191+ **apply command:**
192+
193+ - `--overlay` : Path to the overlay file (alternative to positional argument)
194+ - `--schema` : Path to the OpenAPI specification (alternative to positional argument)
195+ - `-o, --out` : Output file path (optional, defaults to stdout)
196+
197+ **validate command:**
198+
199+ - `--overlay` : Path to the overlay file (alternative to positional argument)
200+
201+ **compare command:**
202+
203+ - `--before` : Path to the first (before) specification file (alternative to positional argument)
204+ - `--after` : Path to the second (after) specification file (alternative to positional argument)
205+ - `-o, --out` : Output file path (optional, defaults to stdout)
178206
179207# # Output Formats
180208
@@ -185,30 +213,39 @@ All commands work with both YAML and JSON input files, but always output YAML at
185213# ## Basic Workflow
186214
187215` ` ` bash
188- # Create an overlay by comparing two specs
216+ # Create an overlay by comparing two specs (using flags)
189217openapi overlay compare --before original.yaml --after modified.yaml --out changes.overlay.yaml
190218
219+ # Or using positional arguments
220+ openapi overlay compare original.yaml modified.yaml --out changes.overlay.yaml
221+
191222# Validate the generated overlay
192- openapi overlay validate --overlay changes.overlay.yaml
223+ openapi overlay validate changes.overlay.yaml
193224
194- # Apply the overlay to the original spec
225+ # Apply the overlay to the original spec (using flags)
195226openapi overlay apply --overlay changes.overlay.yaml --schema original.yaml --out final.yaml
227+
228+ # Or using positional arguments
229+ openapi overlay apply changes.overlay.yaml original.yaml --out final.yaml
196230` ` `
197231
198232# ## Environment-Specific Modifications
199233
200234` ` ` bash
201- # Apply production overlay
235+ # Apply production overlay (using flags)
202236openapi overlay apply --overlay prod.overlay.yaml --schema base-spec.yaml --out prod-spec.yaml
203237
238+ # Or using positional arguments
239+ openapi overlay apply prod.overlay.yaml base-spec.yaml --out prod-spec.yaml
240+
204241# Apply development overlay
205- openapi overlay apply --overlay dev.overlay.yaml --schema base-spec.yaml --out dev-spec.yaml
242+ openapi overlay apply dev.overlay.yaml base-spec.yaml --out dev-spec.yaml
206243` ` `
207244
208245# ## Integration with Other Commands
209246
210247` ` ` bash
211248# Validate base spec, apply overlay, then validate result
212249openapi spec validate ./base-spec.yaml
213- openapi overlay apply --overlay ./modifications.yaml --schema ./base-spec.yaml --out ./modified-spec.yaml
250+ openapi overlay apply ./modifications.yaml ./base-spec.yaml --out ./modified-spec.yaml
214251openapi spec validate ./modified-spec.yaml
0 commit comments