webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Functions
google.protobuf.json_format Namespace Reference

Classes

class  Error
 
class  ParseError
 
class  SerializeToJsonError
 

Functions

def MessageToJson (message, including_default_value_fields=False)
 
def Parse (text, message)
 

Function Documentation

◆ MessageToJson()

def google.protobuf.json_format.MessageToJson (   message,
  including_default_value_fields = False 
)
Converts protobuf message to JSON format.

Args:
  message: The protocol buffers message instance to serialize.
  including_default_value_fields: If True, singular primitive fields,
      repeated fields, and map fields will always be serialized.  If
      False, only serialize non-empty fields.  Singular message fields
      and oneof fields are not affected by this option.

Returns:
  A string containing the JSON formatted protocol buffer message.

◆ Parse()

def google.protobuf.json_format.Parse (   text,
  message 
)
Parses a JSON representation of a protocol message into a message.

Args:
  text: Message JSON representation.
  message: A protocol beffer message to merge into.

Returns:
  The same message passed as argument.

Raises::
  ParseError: On JSON parsing problems.