You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(oas): adding support for common parameter detection to the analyzer (#919)
## 🧰 Changes
This adds support to `oas/analyzer` for surfacing information on if a
given API definition utilizes [common
parameters](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object).
I've also gone through and updated a bunch of bad deep links to parts of
the OAS. Would be nice if the OAI would stop breaking these deep links
every couple of years.
Copy file name to clipboardexpand all lines: packages/oas/README.md
+9-8
Original file line number
Diff line number
Diff line change
@@ -119,8 +119,8 @@ Because this library has full TypeScript types and docblocks this README is not
119
119
<!-- prettier-ignore-start -->
120
120
| Method | Description |
121
121
| :--- | :--- |
122
-
|`.getExtension()`| Retrieve a given [specification extension](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions) if it exists at the root of the API definition. |
123
-
|`.hasExtension()`| Determine if a given [specification extension](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions) exists on the root of the API definition. |
122
+
|`.getExtension()`| Retrieve a given [specification extension](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions) if it exists at the root of the API definition. |
123
+
|`.hasExtension()`| Determine if a given [specification extension](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions) exists on the root of the API definition. |
124
124
|`.validateExtension()`| Determine if a given [ReadMe custom OpenAPI extension](https://docs.readme.com/docs/openapi-extensions) is valid or not. |
125
125
|`.validateExtensions()`| Validate all of our [ReadMe custom OpenAPI extension](https://docs.readme.com/docs/openapi-extensions), throwing exceptions when necessary. |
|`.getContentType()`| Retrieve the primary request body content type. If multiple are present, prefer whichever is JSON-compliant. |
156
-
|`.getDescription()`| Retrieve the `description` that's set on this operation. This supports common descriptions that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject). |
156
+
|`.getDescription()`| Retrieve the `description` that's set on this operation. This supports common descriptions that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object). |
157
157
|`.getOperationId()`| Retrieve the `operationId` that's present on the operation, and if one is not present one will be created based off the method + path and returned instead. |
158
158
|`.hasOperationId()`| Determine if the operation has an `operationId` present. |
159
159
|`.isDeprecated()`| Determine if this operation is marked as deprecated. |
|`.isWebhook()`| Determine if this operation is an instance of the `Webhook` class. |
165
165
|`.getExampleGroups()`| Returns an object with groups of all example definitions (body/header/query/path/response/etc.). The examples are grouped by their key when defined via the `examples` map. |
166
166
|`.getHeaders()`| Retrieve all headers that can either be sent for or returned from this operation. This includes header-based authentication schemes, common header parameters, and request body and response content types. |
167
-
|`.getSummary()`| Retrieve the `summary` that's set on this operation. This supports common summaries that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject). |
168
-
|`.getTags()`| Retrieve all tags, and [their metadata](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tagObject), that exist on this operation. |
167
+
|`.getSummary()`| Retrieve the `summary` that's set on this operation. This supports common summaries that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object). |
168
+
|`.getTags()`| Retrieve all tags, and [their metadata](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tag-object), that exist on this operation. |
> All parameter accessors here support, and will automatically retrieve and handle, common parameters that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject).
185
+
> All parameter accessors here support, and will automatically retrieve and handle, common parameters that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object).
|`.hasExtension()`| Determine if a given [specification extension](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specificationExtensions) exists on this operation. |
234
+
|`.hasExtension()`| Determine if a given [specification extension](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#specification-extensions) exists on this operation. |
235
235
<!-- prettier-ignore-end -->
236
236
237
237
Information about ReadMe's supported OpenAPI extensions at https://docs.readme.com/docs/openapi-extensions.
238
238
239
239
### Callbacks
240
240
241
-
The `Callback` class inherits `Operation` so every API available on instances of `Operation` is available here too. Much like `Operation`, we also support common parameters, summaries, and descriptions that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject) within a `callbacks` definition.
241
+
The `Callback` class inherits `Operation` so every API available on instances of `Operation` is available here too. Much like `Operation`, we also support common parameters, summaries, and descriptions that may be set at the [path item level](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object) within a `callbacks` definition.
|`additionalProperties`| Does your API use `additionalProperties`? |
286
286
|`callbacks`| Does your API use [callbacks](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object)? |
287
287
|`circularRefs`| Does your API have any circular `$ref` pointers, and if so where are they located? |
288
+
|`commonParameters`| Does your API utilize [common parameters](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object)? |
288
289
|`discriminators`| Does your API use polymorphic [discriminators](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#discriminator-object)? |
289
290
|`links`| Does your API use [links](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#link-object)? |
290
291
| `style` | Do any parameters in your API require [style](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#user-content-parameterstyle) serialization?
0 commit comments