Closed almartino closed 3 years ago
@almartino Hi I think you're hitting this because truss doesn't realize it needs to put your create fields in the body, updating your create rpc to (below) should address
rpc CreatePatient (CreatePatientReq) returns (PatientResponse) {
option (google.api.http) = {
post: "/patient"
body: "*"
};
}
@almartino Hi I think you're hitting this because truss doesn't realize it needs to put your create fields in the body, updating your create rpc to (below) should address
rpc CreatePatient (CreatePatientReq) returns (PatientResponse) { option (google.api.http) = { post: "/patient" body: "*" }; }
Hi @zaquestion thanks for the reply, unfortunately I don't use anymore truss, so I'm not able to verify your suggestion.
As from title I'm getting an error when I'm trying to generate this proto:
the command output says:
WARN[0000] Code formatting error, generated service will not build, outputting unformatted code error="257:1: expected statement, found '%'"
And in the http transport, for the generated function
func DecodeHTTPCreatePatientZeroRequest
I get this line:%!(EXTRA string=BirthDateCreatePatient, string=BirthDateCreatePatientStr)
Executed command:
truss proto/patient.proto --svcout ./patient
Generated file
transport_http.go.generated.txt
Notes
If I remove BirthDate from
CreatePatientReq
the generation is done correctly and the problem is clearly onrpc CreatePatient (CreatePatientReq)
part.