gapic-generator-java icon indicating copy to clipboard operation
gapic-generator-java copied to clipboard

Non-primitive values should not be put into path parameters

Open diegomarquezp opened this issue 2 years ago • 6 comments

Similar to #1016 In some cases, the generated client library would put complex object to ~query~ path parameters, like here , the proto definition for this method is here. The generated client library will error out during runtime if non-primitive values are put into query parameters.

diegomarquezp avatar Aug 31 '22 17:08 diegomarquezp

Is this causing a problem somebody suffers from?

suztomo avatar Apr 11 '24 14:04 suztomo

This is hypothesis scenario, we don't have a service proto that is configured this way. But if they do, the generated code would error out during runtime.

blakeli0 avatar Apr 11 '24 16:04 blakeli0

My impression is that if such proto file is introduced it breaks most of the languages. Or is there a specification that GAPIC generator Java hasn't implemented yet?

suztomo avatar Apr 11 '24 17:04 suztomo

I don't think we have an AIP or similar specification that forbid this scenario, the comment in the proto is the closest thing. Yes you are probably right that it would most likely break other languages as well. Ideally this should be validated in a language neutral tool like APILinter as well.

blakeli0 avatar Apr 11 '24 18:04 blakeli0

So the proper solution seems not to make the Java generator to work with such proto files (somehow), but to prevent such proto files.

suztomo avatar Apr 11 '24 18:04 suztomo

So the proper solution seems not to make the Java generator to work with such proto files (somehow), but to prevent such proto files.

Agreed. Maybe it was not clear, what proposed in this issue is to add validation in the Java generator so that the generator would error out instead of erroring out during runtime, if we are not going to do it in a platform level tools.

blakeli0 avatar Apr 11 '24 19:04 blakeli0