ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
137 stars 58 forks source link

GRPC client sample code generation is failing when protobuf schema contains cyclic dependent messages #6837

Open daneshk opened 1 month ago

daneshk commented 1 month ago

Description: When we try to generate the client code from the bal grpc command, the command crashes with a stack overflow error.

Sample proto file.

syntax = "proto3";

message User {
    repeated Group groups = 1;
}

message Group {
    repeated Role roles = 1;
}

message Role {
    repeated User users = 1;
}

Refer to the original issue: https://github.com/wso2-enterprise/internal-support-ballerina/issues/748

This issue comes when generating the sample client code using the stub APIs. It unable to create a sample request due to the cyclic dependency nature of the message type.

This issue is to handle it correctly without throwing a Bad sad error.