Skip to content
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

CoroutineGrpc generated only when asciipb format is used #58

Open
AlexeySoshin opened this issue Jul 23, 2019 · 3 comments
Open

CoroutineGrpc generated only when asciipb format is used #58

AlexeySoshin opened this issue Jul 23, 2019 · 3 comments
Labels
bug Something isn't working config

Comments

@AlexeySoshin
Copy link

Object named <ServiceName>CoroutineGrpc is generated only when ascipb format is used. In both json and yml formats it's not present. Example project: https://github.com/alexeysoshin/KotlinGrpcKroto

My guess is that it has something to do with upper-case and lower case names.

@AlexeySoshin
Copy link
Author

Has to do with empty arrays:
"grpcCoroutines": [] doesn't generate the file, but "grpcCoroutines": [{}] does, in JSON format.

@marcoferrer
Copy link
Owner

marcoferrer commented Jul 23, 2019

Looking at it now, it makes sense. The generator being enabled relies on the existence of at least one configuration being present. The empty {} serializes to one configuration. These two configurations are equivalent.

// asciipb
grpc_coroutines{}
grpc_coroutines{}
{
    "grpcCoroutines":[
       {},
       {}
    ]
}

To your point though, the configuration for json and yaml is confusing. I think this could potentially be fixed by checking if the message is set in the filter utils, but this would need to be tested. In theory it should work since message fields still support hasX checks in proto3. protocolbuffers/protobuf#249

@marcoferrer marcoferrer added bug Something isn't working config labels Aug 2, 2019
@malachid
Copy link

grpcCoroutines: [] is working in yaml version with proto3 with 0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working config
Projects
None yet
Development

No branches or pull requests

3 participants