Swashbuckle.AspNetCore icon indicating copy to clipboard operation
Swashbuckle.AspNetCore copied to clipboard

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

Open wizofaus opened this issue 5 months ago • 3 comments

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 avatar Aug 26 '24 03:08 wizofaus