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

Fixes #1661 - Make IDocumentFilter async compatible #2635

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schehlmj
Copy link

This is my take on the fix for this. Rather than extending IDocumentFilter, I created a new IDocumentAsyncFilter that is configured separately. I chosen to name IDocumentAsyncFilter to help make it clearer for developers. It continues to use a method named "Apply" like other filters, and since they Type itself makes it clear that it is for Async, I did not name the method "ApplyAsync". In cases where GetSwaggerAsync() is called, the IDocumentFilters will run first and then the IDocumentAsyncFilters. For GetSwagger(), only the IDocumentFilters are run. If IDocumentAsyncFilters are configured, it will throw an exception stating to use GetSwaggerAsync() instead.

I had also considered just extending the IDocumentFilter to interface to have an async ApplyAsync() method with a default implementation, but that was not possible with the targeted runtimes.

@schehlmj
Copy link
Author

schehlmj commented Apr 20, 2023

The check failing is:
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.

I am not sure how to have it try again.

@martincostello
Copy link
Collaborator

Thanks for contributing - if you'd like to continue with this pull request, please rebase against the default branch to pick up our new CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants