.NET9 preview's OpenAPI document generation doesn't work when transcoded from gRPC #58010
Closed
1 task done
Labels
area-grpc
Includes: GRPC wire-up, templates
feature-openapi
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
Status: Resolved
Is there an existing issue for this?
Describe the bug
Description:
I am using .NET 9 Preview's built-in support for OpenAPI document generation with gRPC JSON transcoding. However, the OpenAPI document generated contains an empty
paths
object when the transcoding is enabled. The document generates correctly (without empty paths) when I don't use the transcoding service.I've followed the tutorial for gRPC JSON transcoding from .NET 8 (available here) and refactored it to incorporate .NET 9 Preview's built-in OpenAPI support (as described here).
However, the
paths
in the OpenAPI document remain empty.Generated OpenAPI Document:
Program Code:
Expected Behavior
I expect the OpenAPI document to populate the
paths
with the routes corresponding to the gRPC methods exposed via JSON transcoding, similar to how it works without the transcoding services.Actual Behavior
When using gRPC JSON transcoding with
Microsoft.AspNetCore.Grpc.JsonTranscoding
, the generated OpenAPI document has emptypaths
. The issue only occurs when transcoding is enabled.Steps To Reproduce
Microsoft.AspNetCore.OpenApi
andMicrosoft.AspNetCore.Grpc.JsonTranscoding
.Exceptions (if any)
It does not throw any Exceptions. It just doesn't work as intended.
.NET Version
9.0.100-preview.7.24407.12
Anything else?
ASP.NET core 2.66.0
For reproducibility, I have created a repository that contains the setup where this issue occurs. You can find it here: https://github.com/python3js/Transcoding.
The text was updated successfully, but these errors were encountered: