You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
feat: json serialization and deserialization support stringy enums (#112)
For protobuf messages that contain enum fields, it is now possible to
specify that enum variants should be serialized as names and not as integers.
E.g.
json_str = MyMessage.to_json(my_message, enum_strings=True)
Similarly, serialization from json that uses this convention is now supported.
This is useful for interoperation with other data sources that do use
strings to define enum variants in json serialization; and for
debugging, where visually inspecting data structures can be helpful,
and variant names are more informative than numerical values.
Re-addition of #107 with correct support for nested enum definitions
this time.
Includes new tests and modifications to existing tests that take into account
the fact that Enums now share many of the same properties as messages:
their definition adds an entry to the file descriptor proto, out-of-order field
references to enums require resolution, and out-of-file references require
proto-file dependency definition.
0 commit comments