Re: Issue 188 in google-gson: Support handlers for unknown properties, useful for error handling

20 views
Skip to first unread message

googl...@googlecode.com

unread,
Nov 3, 2010, 12:53:49 AM11/3/10
to google-gson...@googlegroups.com
Updates:
Summary: Support handlers for unknown properties, useful for error handling
Labels: -Type-Defect Type-Enhancement Milestone-Release1.7

Comment #1 on issue 188 by limpbizkit: Support handlers for unknown
properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

I think a reasonable fix for this would be to permit the user to register a
handler to be notified whenever an unknown property is encountered. Perhaps
this:
interface UnknownFieldHandler {
void handle(JsonObject object, String name, JsonElement value);
}

Then we could build in a few implementations: one that ignores unknown
fields, one that logs unknown fields, and one that throws on unknown
fields. Users could configure their GSON to be as strict or forgiving as
necessary.

googl...@googlecode.com

unread,
Dec 30, 2011, 2:09:20 AM12/30/11
to google-gson...@googlegroups.com

Comment #2 on issue 188 by limpbiz...@gmail.com: Support handlers for
unknown properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

Issue 262 has been merged into this issue.

googl...@googlecode.com

unread,
Dec 30, 2011, 2:34:36 PM12/30/11
to google-gson...@googlegroups.com

Comment #3 on issue 188 by mst...@gmail.com: Support handlers for unknown

It is good to get object instance, but also is useful information about
character position.

googl...@googlecode.com

unread,
Feb 12, 2012, 3:54:55 PM2/12/12
to google-gson...@googlegroups.com
Updates:
Labels: -Milestone-Release1.7

Comment #4 on issue 188 by limpbiz...@gmail.com: Support handlers for

unknown properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

(No comment was entered for this change.)

googl...@googlecode.com

unread,
Dec 3, 2012, 1:18:27 AM12/3/12
to google-gson...@googlegroups.com

Comment #5 on issue 188 by timp...@gmail.com: Support handlers for
unknown properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

Yuk

googl...@googlecode.com

unread,
Jan 7, 2013, 4:05:33 PM1/7/13
to google-gson...@googlegroups.com

Comment #6 on issue 188 by joeym...@gmail.com: Support handlers for unknown
properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

A handler might not be very Gsonic, but some way to let the Gson client
know that extraneous metadata existed in the subject JSON would be useful.

googl...@googlecode.com

unread,
Jan 12, 2013, 9:17:52 PM1/12/13
to google-gson...@googlegroups.com

Comment #7 on issue 188 by timpyates: Support handlers for unknown
properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

we have been hacked and have not agreed to your terms


googl...@googlecode.com

unread,
Jan 12, 2013, 9:19:12 PM1/12/13
to google-gson...@googlegroups.com

Comment #8 on issue 188 by timpyates: Support handlers for unknown
properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

please help get these people out of our stuff. fbi has been notified and
law enforcement report filed. sincerely,
the real timpyates

googl...@googlecode.com

unread,
Feb 4, 2013, 11:01:21 AM2/4/13
to google-gson...@googlegroups.com
Updates:
Labels: -Priority-Medium Priority-Critical

Comment #9 on issue 188 by limpbizkit: Support handlers for unknown
properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

googl...@googlecode.com

unread,
Feb 4, 2013, 11:02:21 AM2/4/13
to google-gson...@googlegroups.com

Comment #10 on issue 188 by limpbizkit: Support handlers for unknown
properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

Issue 495 has been merged into this issue.

googl...@googlecode.com

unread,
Mar 11, 2014, 5:42:00 AM3/11/14
to google-gson...@googlegroups.com

Comment #11 on issue 188 by ghislain...@gmail.com: Support handlers for
unknown properties, useful for error handling
http://code.google.com/p/google-gson/issues/detail?id=188

Any new about this enhancement ? or a workaround ?


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

googl...@googlecode.com

unread,
Apr 13, 2015, 1:12:41 PM4/13/15
to google-gson...@googlegroups.com

Comment #12 on issue 188 by crkes...@gmail.com: Support handlers for
unknown properties, useful for error handling
https://code.google.com/p/google-gson/issues/detail?id=188

This would be tremendously useful. I'm on a project where we're moving to
GSON to parse a large document that has a ton of optional fields that only
show up sometimes. There's not much documentation on what fields can show
up, so I'm testing by running the parser against vast swaths of these
documents.

But, without some way to spit out what GSON is skipping it's hard to tell
that I've missed parsing a field.

googl...@googlecode.com

unread,
Apr 23, 2015, 3:57:29 PM4/23/15
to google-gson...@googlegroups.com

Comment #13 on issue 188 by basdekw...@gmail.com: Support handlers for
unknown properties, useful for error handling
https://code.google.com/p/google-gson/issues/detail?id=188

This is a very needed feature for me too.
Reply all
Reply to author
Forward
0 new messages