OAS Overlay
This command applies an OpenAPI Overlay 1.0 to an OpenAPI Description.
Usage
The oas-overlay command takes the following parameters:
-
--overlayis the path to the OpenAPI Overlay (either as JSON or YAML) -
--spec(optional) is the path to the OpenAPI Description to transform (either as JSON or YAML) -
--outputis the document to be created (either as JSON or YAML)
The
--specparameter is optional. If omitted, the OAS path is read from theextendsproperty of the Overlay. In this case, the path is relative to the location of the Overlay file itself.You may omit the
--outputflags to write to stdout
Full path is created if the--outputdoes not exist (likemkdir -p)
Examples
Below are a few examples for using the oas-overlay command.
Write to file
Writing the output to a new file
apigee-go-gen transform oas-overlay \
--spec ./examples/specs/oas3/petstore.yaml \
--overlay ./examples/overlays/petstore.yaml \
--output ./out/specs/oas3/petstore-overlaid.yaml
Write To stdout
Writing the output to stdout
apigee-go-gen transform oas-overlay \
--spec ./examples/specs/oas3/petstore.yaml \
--overlay ./examples/overlays/petstore.yaml
Using the extends property
Instead of passing --spec, use the value of the extends property in the overlay