domaindrivendev / Swashbuckle.AspNetCore

Swagger tools for documenting API's built on ASP.NET Core
MIT License
5.25k stars 1.31k forks source link

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

Open wizofaus opened 2 months ago

wizofaus commented 2 months ago

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.

martincostello commented 2 months ago

Please provide a repro as a public GitHub repository.

github-actions[bot] commented 1 week ago

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.

wizofaus commented 1 week ago

I can provide a repro project if needed but not sure when I can get around to it

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: github-actions[bot] @.> Sent: Saturday, October 26, 2024 1:01:33 PM To: domaindrivendev/Swashbuckle.AspNetCore @.> Cc: wizofaus @.>; Author @.> Subject: Re: [domaindrivendev/Swashbuckle.AspNetCore] [Bug]: Swashbuckle hangs generating swagger.json for certain public Controller functions not intended as endpoints (Issue #3047)

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.

— Reply to this email directly, view it on GitHubhttps://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/3047#issuecomment-2439174862, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABI5UAJ5PAY4HRFBOCIQKCLZ5LZX3AVCNFSM6AAAAABNDEO5DWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZZGE3TIOBWGI. You are receiving this because you authored the thread.Message ID: @.***>