- Notifications
You must be signed in to change notification settings - Fork146
[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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
It's true that we don't explicitly support filteringonly webhooks, but looking at the OAS, The filtering feature IMO is document-centric and so should respect the document, especially since we provide a standalone command for IMO the bug here is that we do not filter the webhooks according to the filter parameters, which we should. Footnotes |
If we want to properly support filtering of webhooks in this PR, then it'll be a bit more work. For example, the I guess that means that the standalone filter command on the CLI doesn't work today on documents that contain webhooks. |
mattpolzin commentedFeb 12, 2025
Happy to fix |
mattpolzin commentedFeb 12, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Fixed inOpenAPIKit 3.4.1 andOpenAPIKit 4.0.0-beta.2. |
Once again@mattpolzin, thank you! 🙏 |
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. |
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.