MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / MessageToJson

Method MessageToJson

internal/json.cc:914–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912 }
913
914 absl::Status MessageToJson(const google::protobuf::Message& message,
915 google::protobuf::MessageLite* absl_nonnull result) {
916 std::vector<const google::protobuf::FieldDescriptor*> fields;
917 const auto* reflection = message.GetReflection();
918 reflection->ListFields(message, &fields);
919 if (!fields.empty()) {
920 for (const auto* field : fields) {
921 CEL_RETURN_IF_ERROR(MessageFieldToJson(
922 message, field, InsertField(result, field->json_name())));
923 }
924 }
925 return absl::OkStatus();
926 }
927
928 void StringValueToJson(const well_known_types::StringValue& value,
929 google::protobuf::MessageLite* absl_nonnull result) const {

Callers

nothing calls this directly

Calls 4

MessageFieldToJsonFunction · 0.85
GetReflectionMethod · 0.45
ListFieldsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected