google / google/gson

Provide an @Required annotation to indicate that a field must be present

Open
#61 13 comments 317 reactions 0 assignees View on GitHub
auto-migrated enhancement Milestone-Undefined Priority-Medium Type-Enhancement
Dominant language
Java
Stars
24.2k
Forks
4.5k
Avg merge
6d 4h
Merged PRs (30d)
12

Description

```
See discussion at http://groups.google.com/group/google-
gson/browse_thread/thread/6cfdcc56742357da

During deserialization, Gson should throw a JsonParseException if it finds
that a field marked with @Required is not present.

During serialization, Gson should always write out a field marked @Required
even if it is null.
```

Original issue reported on code.google.com by `inder123` on 17 Oct 2008 at 10:31

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.