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

[Bug]: Swashbuckle hangs generating swagger.json for certain public Controller functions not intended as endpoints #3047

Open
wizofaus opened this issue Aug 26, 2024 · 3 comments
Labels
bug needs-repro A minimal reproducible example is needed

Comments

@wizofaus
Copy link

Describe the bug

I had a function on a controller with a signature

public async Task LookupOrCreateFoo(ScanFooResponse scanFooResponse, IProfileOperations profileOperations, Func<Task<byte[]>> getInvoice)

that just by the virtue of existing caused the swagger middle ware that generates swagger.json to hang.

It appears specifically it's hanging inside DefaultApiDescriptionProvider.OnProvidersExecuting( ) so it may even be a .NET bug.

Removing "public" from the signature fixed it (it didn't need to be public).

Expected behavior

Shouldn't hang.

Actual behavior

Attempt to request swagger.json is never responded to.

Steps to reproduce

No response

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

6.7.2

.NET Version

8.0

Anything else?

Didn't happen prior to upgrading to .NET 8/Swashbuckle 6.7.2

Had observed previously when I had a public OnActionExecuting( ) function in a controller too.

@wizofaus wizofaus added the bug label Aug 26, 2024
@martincostello
Copy link
Collaborator

martincostello commented Aug 26, 2024

Please provide a repro as a public GitHub repository.

@martincostello martincostello added the needs-repro A minimal reproducible example is needed label Aug 26, 2024
Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

@github-actions github-actions bot added the stale Stale issues or pull requests label Oct 26, 2024
@wizofaus
Copy link
Author

wizofaus commented Oct 26, 2024 via email

@github-actions github-actions bot removed the stale Stale issues or pull requests label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-repro A minimal reproducible example is needed
Projects
None yet
Development

No branches or pull requests

3 participants
@martincostello @wizofaus and others