Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(oas): adding support for common parameter detection to the analyzer #919

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

erunion
Copy link
Member

@erunion erunion commented Dec 13, 2024

🧰 Changes

This adds support to oas/analyzer for surfacing information on if a given API definition utilizes common parameters.

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.

@erunion erunion added the enhancement New feature or request label Dec 13, 2024
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object}
*/
export function commonParameters(definition: OASDocument) {
return query(['$..paths[*].parameters'], definition).map(res => refizePointer(res.pointer));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe the answer is "no" but just to double check — are there any other places in the tree where a parameter can be defined (other than at the path- and operation-level)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, this is the only place

@@ -119,8 +119,8 @@ Because this library has full TypeScript types and docblocks this README is not
<!-- prettier-ignore-start -->
| Method | Description |
| :--- | :--- |
| `.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. |
| `.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. |
| `.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. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of this work looks crazy tedious and i'd love to figure out how to auto-generate docs like these at some point, but in the meantime... bless u for this

@erunion erunion merged commit 05ad5c1 into main Dec 16, 2024
6 checks passed
@erunion erunion deleted the feat/analyzer-common-params branch December 16, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants