Description
Currently, attempting to generate C# from a proto2 file produces the following:
C# code generation only supports proto3 syntax
This makes sense - however, it would be tremendously useful to have a mode/switch that will silently ignore the unsupported syntax, and produce code that just doesn't honour the required/optional statements
Rationale
proto files are frequently shared between multiple languages/tools - and because 'required' is enforced differently by certain libraries/implementations, sometimes it is useful to have this statement in the .proto, even if you don't want it to do anything when using C# codegen
For example, protobuf-jsonschema can generate JSON schemas with the necessary 'required' attributes.
Moving to proto3
Moving to proto3 syntax and just dropping required and optional is fine - the problem is that other tools/libraries that are doing something useful with the extra attributes cease to do so
The only alternative is to either have multiple copies of the file (which is obviously not helpful) or to preprocess the files ourselves before running protoc
Activity