to the imports when Empty is being used in the proto file (not sure how to do that programatically though) together with updating all uses of Empty struct with empty.Empty wherever .Input.Name or .Output.Name equals Empty in the template context:
There is an another problem with JSON decoding of the request with empty body. The http.StatusPreconditionFailed EOF error is being returned. Removing of the JSON decoding
of the request when the type is Empty fixes the issue.
When using empty request body in api calls, the resulting generated code won't compile, e.g.:
when generated using:
results in the following handler func:
which leads to the following compile error:
this can be easily fixed by adding:
to the imports when Empty is being used in the proto file (not sure how to do that programatically though) together with updating all uses of
Empty
struct withempty.Empty
wherever.Input.Name
or.Output.Name
equalsEmpty
in the template context:There is an another problem with JSON decoding of the request with empty body. The http.StatusPreconditionFailed EOF error is being returned. Removing of the JSON decoding of the request when the type is Empty fixes the issue.