scalapb / scalapb-validate

ScalaPB generator for PGV
Apache License 2.0
14 stars 10 forks source link

How to use `scalapb-validate` when using scalapb protoc plugin? #260

Closed onsah closed 1 year ago

onsah commented 1 year ago

We are using scalapb as a protoc plugin to generate the Scala definitions in a gradle project. I would like to generate validators to be used, but the guide seems to only explain how to integrate with sbt-based scalapb. I am wondering is it possible to generate validators when using the protoc plugin? If it's how can I achieve it?

thesamet commented 1 year ago

Hi Onur, for scalapb-validate we have an executable jar you can. They are available here: https://repo1.maven.org/maven2/com/thesamet/scalapb/protoc-gen-scalapb-validate/0.3.4/ . Use the one that ends with unix.sh or windows.bat depending on the OS you are building, unix.sh is good for both Mac and Linux OS.

onsah commented 1 year ago

@thesamet Thanks for the quick response! That's great I will try it.

I didn't see this in documentation, did I miss it? If it's not present there I may work on adding it to the documentation.

onsah commented 1 year ago

It worked. Thanks!