Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Adds note about gson map decoding to README
  • Loading branch information
Adrian Cole committed Aug 29, 2016
commit f8e563c2f732f3a1772c289cd1dcf384ae0af1f0
8 changes: 8 additions & 0 deletions gson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ GitHub github = Feign.builder()
.decoder(new GsonDecoder())
.target(GitHub.class, "https://api.github.com");
```

### Map<String, Object> and Numbers
The default constructors of `GsonEncoder` and `GsonDecoder` decoder numbers in
`Map<String, Object>` as Integer type. This prevents reading `{"counter", "1"}`
as `Map.of("counter", 1.0)`. This uses an internal class in gson.

If you want the default behavior, or cannot use gson internal classes (ex in
OSGi), please use the constructors that accept a Gson object.