Skip to content

Grpc transcoding in .net 7 - cannot post repeated field #47510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
victorsauter opened this issue Mar 30, 2023 · 3 comments · Fixed by #47511
Closed

Grpc transcoding in .net 7 - cannot post repeated field #47510

victorsauter opened this issue Mar 30, 2023 · 3 comments · Fixed by #47511
Labels
area-grpc Includes: GRPC wire-up, templates

Comments

@victorsauter
Copy link

victorsauter commented Mar 30, 2023

Hi,

I'm trying to use the new great feature "grpc json transcoding", but I'm getting an error when I try to pass to the body a repeated field.

My proto :

syntax = "proto3";

import "Protos/google/api/annotations.proto";

option csharp_namespace = "GrpcGreeter";

package greet;

// The greeting service definition.
service Greeter {
  rpc AddGreeting (AddRequest) returns (AddReply){
    option (google.api.http) = {
      post: "/greet"
      body: "greetings"
    };
  }
}

message AddRequest {
  repeated Greeting greetings = 1;
}

message AddReply {
  repeated Greeting greetings = 1;
}

message Greeting {
  string name = 1;
  string level = 2;
  string comment = 3;
}

The error :
image

So, if i understand correctly, it's not supported yet, am I right ?


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@victorsauter victorsauter changed the title Grpc transcoding - cannot post repeated field Grpc transcoding in .net 7 - cannot post repeated field Mar 30, 2023
@JamesNK JamesNK transferred this issue from dotnet/AspNetCore.Docs Mar 31, 2023
@ghost ghost added the area-grpc Includes: GRPC wire-up, templates label Mar 31, 2023
@JamesNK
Copy link
Member

JamesNK commented Mar 31, 2023

I think this is an issue in gRPC JSON transcoding. Transferred to dotnet/aspnetcore repo.

@JamesNK
Copy link
Member

JamesNK commented Mar 31, 2023

A bug prevents binding a JSON body to a repeating collection of messages. It was tested with primitive values (i.e. a collection of strings) but not a collection of messages.

This will be fixed in .NET 8. Will look to see if it can be also fixed in a .NET 7 servicing release.

@victorsauter
Copy link
Author

Okay great ! Thanks a lot :)

@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-grpc Includes: GRPC wire-up, templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants