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

Versioning with Grpc Json Transcoding

Open BigHoss opened this issue 1 year ago • 5 comments

Description

There is not a lot of usable documentation how to implement versioning in a meaningful way for swagger. But there is absolutely none of how this could be possible with json transcoding

Page URL

https://learn.microsoft.com/en-us/aspnet/core/grpc/json-transcoding?view=aspnetcore-8.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/grpc/json-transcoding.md

Document ID

25375ca1-0ce8-a3ca-0c3a-446328f09ba1

Article author

@JamesNK

BigHoss avatar Jul 09 '24 15:07 BigHoss

@JamesNK, with changes produced so far around OpenAPI support in .NET 9 preview (and its project templates) is there a particular approach I should take here in a new section or new topic, and should that happen after .NET 9 is GA and the dust settles? Thoughts?

wadepickett avatar Jul 09 '24 19:07 wadepickett

The ideas talked about in https://learn.microsoft.com/en-us/aspnet/core/grpc/versioning?view=aspnetcore-8.0 for versioning gRPC also apply to gRPC JSON transcoding.

JamesNK avatar Jul 10 '24 02:07 JamesNK

Then how and where can i configure the versioning for swagger to work with it?

BigHoss avatar Jul 10 '24 06:07 BigHoss

As there is no information available how to do it (and as far as I saw, the versioning is only done in the URL property, so no logic for swagger to detect which is what), can you point me towards a way of solving that?

BigHoss avatar Aug 21 '24 07:08 BigHoss

@JamesNK After reading loads and loads of github issues about this i think i found the right way to implement it. Unfortunately i now get a NotImplementedException on the WithApiVersionSet() method

Please find a project showcasing this issue here

BigHoss avatar Aug 21 '24 11:08 BigHoss