You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updates docs for ScalaPB Validation
* Adds explanation about how to enable the validation
* Apply suggestions from code review
Co-authored-by: Francisco Diaz <[email protected]>
Co-authored-by: Francisco Diaz <[email protected]>
Copy file name to clipboardexpand all lines: microsite/src/main/docs/reference/source-generation.md
+27
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,7 @@ muSrcGenSerializationType := SerializationType.Protobuf // or SerializationType.
81
81
|`muSrcGenCompressionType`| The compression type that will be used by generated RPC services. Set to `higherkindness.mu.rpc.srcgen.Model.GzipGen` for Gzip compression. |`higherkindness.mu.rpc.srcgen.Model.NoCompressionGen`|
82
82
|`muSrcGenIdiomaticEndpoints`| Flag indicating if idiomatic gRPC endpoints should be used. If `true`, the service operations will be prefixed by the namespace. |`true`|
83
83
|`muSrcGenProtocVersion`| Specifies the protoc version that [ScalaPB](https://scalapb.github.io/) should use when generating source files from proto files. |`None` (let ScalaPB choose the protoc version) |
84
+
|`muSrcGenValidateProto`| Flag indicating if the plugin should generate validation methods based on rules and constraints defined in the specs. Only proto is supported at this moment. |`false`|
The sbt-mu-srcgen supports the plugin [scalapb-validate](https://github.com/scalapb/scalapb-validate).
116
+
This plugin generates validators for your models, using the base validators defined by the [PGV protoc plugin](https://github.com/envoyproxy/protoc-gen-validate)
117
+
118
+
As you probably guessed, this is only compatible with proto and the setting will be ignored when working with Avro files.
119
+
120
+
To enable the validation methods generation, you need to set the setting `muSrcGenValidateProto` to true and
121
+
import the PVG validators provided transitively by the `scalapb-validate-core` protobuf library:
0 commit comments