-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an @Required annotation to indicate that a field must be present #61
Comments
Does Gson have this feature yet ? |
I am able to achieve this using this approach. This is for serialization (fail Java to Json if some @required attribute is null) |
Seems that no one cares this library. This issue should be marked as critical. |
There's a library that's can help with this: |
Still waiting for this feature... I want my Gson deserializing to throw an exception when a JSON doesnt have a parameter which my object do have and is either marked as |
I would love to see this feature implemented as well. |
To anyone still frustrated with the lack of required fields option in Gson, you can use Rave. It solves this problem nicely if you want to avoid NPEs from unreliable APIs. |
is this still not available?? |
seems not. Really annoying. |
Well, you can use my fork if you really need this. They seemingly aren't interested in merging that pull request. |
Any news on this? |
Related to #1005; if there was a general "missing field strategy" you could at least easily implement a |
Original issue reported on code.google.com by
inder123
on 17 Oct 2008 at 10:31The text was updated successfully, but these errors were encountered: