-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Configurable AllowUnknownFields in jsonpb? #448
Comments
Does WithMarshalerOption solve your issue? We use this to configure a jsonpb.Marshaler the way we like:
|
Oh, no, it does not solve your issue. The offending line is here: That unmarhsaler should be configurable. Maybe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now unknown object fields are silently dropped.
If I want to handle such cases, I have to provide a custom unmarshaller (likely by copying all unmarshalling stuff from runtime/marshal_jsonpb.go and changing AllowUnknownFields to false). Isn't it better to make this parameter configurable?
P.S. There will probably be some API change:
type JSONPb jsonpb.Marshaler will likely change to
type JSONPb struct{...}
Which will require existing code modification.
The text was updated successfully, but these errors were encountered: