gripmock
gripmock copied to clipboard
add proto3 optional feature to protogen
Added proto3 optional fields feature to protogen plugin
Bump - would really like to see this feature get merged.
This is great! We would love to see this change merged.
@jekiapp We would love to see support for optional fields merge as well. Is this PR still valid or should I create a new one with some changes?
I think bumping up of protoc image version in gripmock is proper answer for this.
Hi guys sorry for a late reply, what is the motivation of this feature? I know it's just one line, but still it's not so obvious what the impact will be.
@NikolayOskin since the tests also not updated to prove this works, I need to do test it in local first. Updating the example tests would be helpful.
Hi @jekiapp Using https://registry.hub.docker.com/layers/tkpd/gripmock/latest/images/sha256-a8b72b039d9b66e797b87b8ff0c4668cd6202ee934037d316cde310686491c22?context=explore I still see the error:
mock-grpc-service-1 | Starting GripMock
mock-grpc-service-1 | Serving stub admin on http://:4771
mock-grpc-service-1 | data/Test.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-gripmock hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--gripmock_out:
mock-grpc-service-1 | 2023/05/16 11:21:47 Fail on protoc exit status 1
mock-grpc-service-1 exited with code 1
My type is:
syntax = "proto3";
package data;
message Test {
optional uint64 x = 1;
}
@jekiapp Could you take a look? @NikolayOskin is it working for you? Thank you in advance.
I'm getting the same error as above about protoc-gen-gripmock
using the tkpd/gripmock:v1.12.1
image. Thank you.
Bumping this, I'm getting the same error as above. Any progress on this?
is a proto3 file that contains optional fields, but code generator protoc-gen-gripmock hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--gripmock_out:
Well, this merge fixed it for me - but it's not part of the latest release as merge happened on May 9, and 1.12.1 dates back to Feb.
To leverage this fix, I've built from github, as we don't have this in dockerhub until the next release at least. Clone & docker build works.
Example docker-compose snippet:
version: "3.9"
services:
gripmock:
build:
context: https://github.com/tokopedia/gripmock.git
ports:
...
Hope that helps those running into this
Thank you @miklosbagi, that worked for me.
@jekiapp could you please update the latest tag of the docker.com/r/tkpd/gripmock too?
please re-pull the latest image, just built the v1.13 and made it latest version. https://hub.docker.com/layers/tkpd/gripmock/latest/images/sha256-e50455d0aef6d3691742e90e0c3296cee54d7e298571dac17b897d7f6e5b054c?context=repo