Fails to serialize Boolean using Jackson-Gson bridge
@@ -89,7 +89,11 @@ public class JsonGeneratorWriter extends JsonWriter implements Callable<JsonGene
@Override
public JsonWriter value(String value) throws IOException {
+ if (value == null) {
+ generator.writeNull();
+ } else {
generator.writeString(value);
+ }
return this;
}
@@ -105,6 +109,16 @@ public class JsonGeneratorWriter extends JsonWriter implements Callable<JsonGene
return this;
}
+ @Override
+ public JsonWriter value(Boolean value) throws IOException {
+ if (value == null) {
+ generator.writeNull();
+ } else {
+ generator.writeBoolean(value);
+ }
+ return this;
+ }
+
@Override
public JsonWriter value(double value) throws IOException {
if (!isLenient() && (Double.isNaN(value) || Double.isInfinite(value))) {
