Open sbwalker opened 5 hours ago
Please turn on more logging (debug/trace) so you can see the exception details, or set a breakpoint on InvalidOperationException in VS so you can see where the exception is coming from.
the actual exception is:
Unsupported parameter source: ModelBinding
Microsoft.AspNetCore.OpenApi
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.<GetParametersAsync>d__28.MoveNext()
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.<GetOperationAsync>d__21.MoveNext()
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.<GetOperationsAsync>d__20.MoveNext()
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.<GetOpenApiPathsAsync>d__19.MoveNext()
at Microsoft.AspNetCore.OpenApi.OpenApiDocumentService.<GetOpenApiDocumentAsync>d__12.MoveNext()
at Microsoft.AspNetCore.Builder.OpenApiEndpointRouteBuilderExtensions.<>c__DisplayClass0_0.<<MapOpenApi>b__0>d.MoveNext()
at Microsoft.AspNetCore.Http.Generated.<GeneratedRouteBuilderExtensions_g>F56B68D2B55B5B7B373BA2E4796D897848BC0F04A969B1AF6260183E8B9E0BAF2__GeneratedRouteBuilderExtensionsCore.<>c__DisplayClass2_0.<<MapGet0>g__RequestHandler|5>d.MoveNext()
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<<Invoke>g__AwaitRequestTask|7_0>d.MoveNext()
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.<Invoke>d__5.MoveNext()
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.<Invoke>d__6.MoveNext()
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.<Invoke>d__11.MoveNext()
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
at Oqtane.Infrastructure.JwtMiddleware.<Invoke>d__2.MoveNext()
in C:\Source\Projects\oqtane.framework\Oqtane.Server\Infrastructure\Middleware\JwtMiddleware.cs:line 88
Line 88 in Jwtmiddleware is simply:
if (_next != null) await _next(context);
Is there an existing issue for this?
Describe the bug
I am trying to integrate OpenAPI into an existing Blazor project which was recently upgraded to .NET 9.
I added the following project reference to the Server project:
I modified the Startup.cs (yes this project has never migrated to the "new" Program.cs approach - but that should not affect the result):
Note that this application is using traditional Controllers and Razor Pages - not minimal APIs.
When I run the application and browse to /openapi/v1.json I get a blank screen with no output:
The Visual Studio console contains the following information:
Expected Behavior
Browsing to /openapi/v1.json should display the Open API document
Steps To Reproduce
No response
Exceptions (if any)
Exception thrown: 'System.InvalidOperationException' in System.Private.CoreLib.dll
.NET Version
9.0.0-rc.2.24473.5
Anything else?
Note that this application already had Swagger integrated previously:
and the Swagger UI still works fine: