This is a Workato Connector generator for Google Protocol Buffers compiler protoc. The plugin generates a Connector file based on your publicly tagged methods.
go install github.com/SafetyCulture/protoc-gen-workato@latestThe plugin is invoked by passing the --workato_out, and --workato_opt options to the protoc compiler. The option has the following format:
--doc_opt=workato/config.yamlGeneration of the actions in workato relies on the usage of google.api.http and grpc.gateway.protoc_gen_openapiv2.options annotations.
A complete example can be found in proto/.
This repo uses buf to build Protocol Buffers.
brew tap bufbuild/buf
brew install bufTo generate the image for fixtures run buf build -o fixtures/image.bin.
To generate the annotations Go package run buf generate.
Example buf generate s12/protobuf/workato/annotations.proto.
go test -v -run TestGenerateWorkatoConnectorAfter you are happy with the results, to update the snapshot run this command:
UPDATE_SNAPSHOTS=true go test -v -run TestGenerateWorkatoConnectorTo test locally, you can use this command in cmd/protoc-gen-workato folder
go install ./...Will install in your go/bin folder a binary with the name protoc-gen-workato
After this, go to the APISchema repository and run:
buf generate --template buf.gen.workato.yaml -o "_generated/workato"This will enable you to manually check the generated file and compare to the one generated by the old generator cmd:
make workato