Skip to content

Use google.protobuf.json_format for resource.dict_to_struct and resource.struct_to_dict #108

@negz

Description

@negz

What problem are you facing?

We have two helpers to convert between Python dictionaries and protobuf structs:

  • resource.struct_to_dict(some_struct)
  • resource.dict_to_struct(some_dict)

I believe these are equivalent to:

  • google.protobuf.json_format.MessageToDict(some_struct)
  • google.protobuf.json_format.ParseDict(some_dict, empty_struct)

How could this Function help solve your problem?

I think we should keep our helpers for discoverability/backward compatibility, but have them just use the json_format equivalents under the hood.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions