Changed JSON decoding error message to be more clear.

"No such field:" is more clear than "Unknown field:",
because "unknown field" is a term of art within protocol
buffers that implies that we are preserving the field.

Also "No such field:" matches the pre-existing Ruby
error message.
pull/13171/head
Joshua Haberman 4 years ago
parent f41c0ec261
commit 88ed8f5d3b
  1. 2
      upb/json_decode.c

@ -906,7 +906,7 @@ static void jsondec_field(jsondec *d, upb_msg *msg, const upb_msgdef *m) {
if (!f) {
if ((d->options & UPB_JSONDEC_IGNOREUNKNOWN) == 0) {
jsondec_errf(d, "Unknown field: '" UPB_STRVIEW_FORMAT "'",
jsondec_errf(d, "No such field: '" UPB_STRVIEW_FORMAT "'",
UPB_STRVIEW_ARGS(name));
}
jsondec_skipval(d);

Loading…
Cancel
Save