gapic-generator-java
gapic-generator-java copied to clipboard
Non-primitive values should not be put into path parameters
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.
Is this causing a problem somebody suffers from?
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.
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?
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.
So the proper solution seems not to make the Java generator to work with such proto files (somehow), but to prevent such proto files.
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.