utrack / clay

Proto-first minimal server platform for gRPС+REST+Swagger APIs
MIT License
290 stars 37 forks source link

Does not correctly generate pb.goclay.go with filed option nullable = false #93

Closed sshaplygin closed 4 years ago

sshaplygin commented 4 years ago

Clay does not correct generate .pb.goclay.go file, if in proto-file exists into body exists one of proto-field with [(gogoproto.nullable) = false];

Example proto-file

rpc UserV1 (UserRequest) returns (UserResponse) {
        option (google.api.http) = {
            post: "UserV1"
            body: "user"
        };
    }

...
message UserRequest {
    User user = 1; [(gogoproto.nullable) = false];
}

Example piece generated code into .pb.goclay.go

...
req.User = &User{}
...

Error into generate template - https://github.com/utrack/clay/blob/master/cmd/protoc-gen-goclay/genhandler/template.go#L310

sshaplygin commented 4 years ago

Resolved