-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for proto3 optional
#72
Comments
Extremely need this feature! |
Just patch generator.go to also support optional keyword in proto files. diff --git a/protoc-gen-gripmock/generator.go b/protoc-gen-gripmock/generator.go
index cdd2258..5cb63b6 100644
--- a/protoc-gen-gripmock/generator.go
+++ b/protoc-gen-gripmock/generator.go
@@ -34,6 +34,7 @@ func main() {
// Initialise our plugin with default options
opts := protogen.Options{}
plugin, err := opts.New(&request)
+ plugin.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
if err != nil {
log.Fatalf("error initializing plugin: %v", err)
} |
Also faced:( |
It's because of protoc in gripmock image is 3.12.2 which cannot support optional field. I tried to fix it, but all of my effort was unnecessary. |
Looks like PR #119 is open for this, but unmerged/unreviewed with no comments. |
I see that #119 was merged and (as far as I can tell) released in version 1.13. Does that mean that this issue is resolved and should be closed? |
sorry, forgot to close. Released in 1.13 |
Hey there, great job on making this, it is much needed.
I tried using the package, but it seems
optional
is not supported. When running the package, I getThis file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
, so maybe it's as simple as passing the experimental flag toproto-gen
?Cheers
The text was updated successfully, but these errors were encountered: