Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug] Exclude webhooks when filter is provided#734

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
czechboy0 wants to merge3 commits intoapple:main
base:main
Choose a base branch
Loading
fromczechboy0:hd-filter-out-webhooks

Conversation

czechboy0
Copy link
Contributor

Motivation

Fixes#712.

When an OpenAPI document includes webhooks that include schema references, and a filter is provided, the generator would fail unless all the schemas needed by all webhooks were explicitly included in the filter.

Modifications

Since we don't currently support filtering webhooks, just exclude them always when a filter is provided. This fixes the bug.

In the future, if we add support for webhooks, we can add support for filtering them as well.

Result

Unblocks generating GitHub's OpenAPI 3.1.0 doc + filters.

Test Plan

Adapted the filtering unit test, verified it fails without the fix, and passes with it.

@simonjbeaumont
Copy link
Collaborator

Since we don't currently support filtering webhooks, just exclude them always when a filter is provided. This fixes the bug.

In the future, if we add support for webhooks, we can add support for filtering them as well.

It's true that we don't explicitly support filteringonly webhooks, but looking at the OAS,webhooks: is aMap[string, Path Item Object]1, and path items contain operations, which, in turncan have operation IDs and/or tags.

The filtering feature IMO is document-centric and so should respect the document, especially since we provide a standalone command forfilter.

IMO the bug here is that we do not filter the webhooks according to the filter parameters, which we should.

Footnotes

  1. https://spec.openapis.org/oas/latest.html#fixed-fields

@czechboy0
Copy link
ContributorAuthor

If we want to properly support filtering of webhooks in this PR, then it'll be a bit more work. For example, theallOperationIds property on Document in OpenAPIKit doesn't include operations from webhooks, which will break for examplethis invariant, if we allow operationIds from webhook operations. Not sure if that means we should wait for a fix in OpenAPIKit (cc@mattpolzin) or if we should try to reimplement it on our end.

I guess that means that the standalone filter command on the CLI doesn't work today on documents that contain webhooks.

@mattpolzin
Copy link

Happy to fixallOperationIds to include webhooks. I’ve got the work trackedhere.

czechboy0 and MahdiBM reacted with thumbs up emoji

@mattpolzin
Copy link

mattpolzin commentedFeb 12, 2025
edited
Loading

Fixed inOpenAPIKit 3.4.1 andOpenAPIKit 4.0.0-beta.2.

MahdiBM and czechboy0 reacted with thumbs up emoji

@simonjbeaumont
Copy link
Collaborator

Once again@mattpolzin, thank you! 🙏

@czechboy0
Copy link
ContributorAuthor

Thanks@mattpolzin!

I started implementing the webhook filtering properly, but it's quickly growing into more work, so I'll have to put this aside for now and come back to when I have more time. Or someone else can pick it up if we need it sooner. For now we'll need to recommend adopters use the 3.0 GitHub OpenAPI doc, rather than 3.1, so they shouldn't be blocked.

@czechboy0czechboy0 marked this pull request as draftFebruary 13, 2025 09:08
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@simonjbeaumontsimonjbeaumontAwaiting requested review from simonjbeaumont

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
🔨 semver/patchNo public API change.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

OpenAPI docs with webhooks + schema refs fail with filtering
3 participants
@czechboy0@simonjbeaumont@mattpolzin

[8]ページ先頭

©2009-2025 Movatter.jp