Skip to content

Commit bcc188f

Browse files
committed
Updates from pull request reviews
1 parent f94d0de commit bcc188f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

overlay/example-add-filter-parameters.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ has_toc: false
99
# Example: Add multiple parameters to selected operations
1010

1111
One of the most requested features for OpenAPI is the ability to group parameters and easily apply all of them together, to either some or all operations in an OpenAPI description.
12-
Especially for common parameters that always come as a set (pagination or filter parameters are a great example), it can be more maintainable to use them as a "trait" and apply the set as part of the API lifecycle rather than trying to maintain a source of truth that has all the correct fields everywhere.
12+
Especially for common parameters that always come as a set (pagination or filter parameters are a great example), it can be more maintainable to use them as a "trait" and apply the set as part of the API lifecycle rather than trying to maintain a source of truth with a lot of repetition.
13+
This approach leads to good API governance, since if the collection of fields changes then the update is consistently applied through automation.
1314

1415
In the following example, any operations with the extension `x-supports-filters` set to `true` will have two inline parameters added to their parameter collection, and an `x-filters-added` tag for decoration/debugging.
1516

@@ -42,5 +43,5 @@ You can adjust the target expression to apply only to certain paths or methods,
4243
It might be more elegant to first update the `components.parameters` section of an OpenAPI description to add the parameters there, and then refer to those new entries when updating the existing operations.
4344
The Overlay Specification requires that each action is processed in the order it is seen in the Overlay document.
4445

45-
The 1.0 specification has a [traits example](https://spec.openapis.org/overlay/v1.0.0.html#traits-example) that uses the `x-oas-traits` extension.
46+
The 1.0 specification has a [traits example](https://spec.openapis.org/overlay/v1.0.0.html#traits-example) that uses the `x-oas-traits` [Specification Extension](https://spec.openapis.org/oas/v3.1.1.html#specification-extensions).
4647
This extension is a useful convention to consider when you use a pattern like the one described here.

overlay/index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ has_toc: false
88

99
# Introduction to OpenAPI Overlay Specification
1010

11-
The [Overlay Specification](https://spec.openapis.org/overlay/latest.html) defines a document format for information that augments an existing OpenAPI description yet remains separate from the OpenAPI description's source document(s).
11+
The [Overlay Specification](https://spec.openapis.org/overlay/latest.html) defines a document format for information that transforms an existing OpenAPI description yet remains separate from the OpenAPI description's source document(s).
12+
The goal of the Overlay Specification is to provide a mechanism for providing consistent, deterministic updates to a given OpenAPI description, as an aid to automation throughout the API lifecycle.
13+
1214
An Overlay can be applied to an OpenAPI description, resulting in an updated OpenAPI description.
1315

1416
> **OpenAPI + Overlays = (better) OpenAPI**
1517
18+
One Overlay might be specific to one OpenAPI description, or general enough to be used with multiple OpenAPI descriptions.
19+
Equally, one OpenAPI description pipeline might apply different Overlays during the workflow.
20+
21+
## Use cases for Overlays
22+
1623
Overlays support a range of scenarios, including:
1724

1825
- Translating documentation into another language

0 commit comments

Comments
 (0)