diff --git a/all/entrypoint.sh b/all/entrypoint.sh index 9a9545a9..1f30e4dc 100755 --- a/all/entrypoint.sh +++ b/all/entrypoint.sh @@ -484,7 +484,7 @@ if [ $GEN_GATEWAY = true ]; then mkdir -p ${GATEWAY_DIR} protoc $PROTO_INCLUDE \ - --grpc-gateway_out=logtostderr=true:$GATEWAY_DIR ${PROTO_FILES[@]} \ + --grpc-gateway_out=${GO_SOURCE_RELATIVE}logtostderr=true:$GATEWAY_DIR ${PROTO_FILES[@]} \ --grpc-gateway_opt generate_unbound_methods=$GENERATE_UNBOUND_METHODS if [[ $OPENAPI_JSON == true ]]; then diff --git a/all/test/all_test.go b/all/test/all_test.go index 68a244a6..728a0094 100644 --- a/all/test/all_test.go +++ b/all/test/all_test.go @@ -338,6 +338,21 @@ func (s *TestSuite) TestAllCases() { }, extraArgs: []string{"--with-gateway"}, }, + "go with gateway and source_relative": { + lang: "go", + protofileName: "all/test/test.proto", + expectedOutputDir: "gen/pb-go", + fileExpectations: []FileExpectation{ + {fileName: "all/test/test.pb.go"}, + {fileName: "/all/test/test.pb.gw.go", assert: func(filePath, expectedValue string) { + fileText := s.readFile(filePath) + s.Assert().False(strings.Contains(fileText, expectedValue), "contains \"%s\"", expectedValue) + }, expectedValue: "UnboundUnary", + }, + {fileName: "/all/test/test.swagger.json"}, + }, + extraArgs: []string{"--with-gateway", "--go-source-relative"}, + }, "go with gateway and json": { lang: "go", protofileName: "all/test/test.proto",