protoc-gen-validate
protoc-gen-validate copied to clipboard
csharp support
I want to implement support for csharp in this generator. I would like to ask some questions before I begin.
Are there any other initiatives/plans on this? My very limited search didn't provide any results.
Looking into the code and taken the java
implementation as reference, I would say that a high level flow of the generator is:
- implement the rules the project in
csharp
undercsharp
folder -
protoc --csharp_out=. --validate_out="lang=csharp:." service.proto
- render templates under
templates/csharp
for messages using code from step 1
Does step 1 require protoc --csharp_out=./csharp -I validate/ validate/validate.proto
?
Cheers.
Yeah, that would be great! Just to calibrate expectations, are you signing up to maintain C# support as well? That would mostly involve consulting when there's some idiomatic language thing that works differently in C# than in the other languages, and helping getting the build/test working initially.
- implement the rules the project in csharp under csharp folder
Java is a special beast because of the requirements for its directory structure (and the Python version is totally different from other languages and generates code on the fly). If you can avoid having a language-specific directory that's great, otherwise not a big deal.
Ideally almost everything C#-specific goes under templates/csharp
with a similar template structure to the existing code.
Looks like there are Bazel rules for C#, which is great! https://github.com/bazelbuild/rules_dotnet
Last year I was looking into adding support for C# (#361), but I didn't find the time to resolve some open topics. Maybe you can use this a starting point.
any updates on this?
In my case...
Makefile
.PHONY: create
create:
mkdir -p gen/csharp
protoc -I=. --csharp_out=./gen/csharp proto/validate/validate.proto
protoc -I=. -I ${GOPATH}/pkg/mod -I ${GOPATH}/pkg/mod/github.com/envoyproxy/[email protected] --csharp_out=gen/csharp/ proto/v1/*/*.proto
directory structure /proto /proto/v1 /proto/v1/xxx /proto/v1/xxx/xxx.proto /proto/validate /proto/validate/validate.proto
Why was it closed? Is C# added or it is decided that there will be no support for C#
Thank you for reaching out and expressing your interest in having C# support for protoc-gen-validate
.
While we won't be adding C# support to protoc-gen-validate
, I'd like to point out that there's an open issue regarding C# support in the protovalidate
project. You can find it here. This issue captures a similar request, and I encourage you to keep an eye on its progress.
As we're actively developing protovalidate
to offer a more comprehensive experience, your input is valued. I'll be closing this issue. If you have more suggestions or questions in the future, feel free to get in touch. Thank you for your engagement!