File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,11 @@ public RequestBody serialize(Object obj) throws AlgoliaRuntimeException {
239
239
240
240
if (obj != null ) {
241
241
try {
242
- content = json .writeValueAsString (obj );
242
+ if (obj .getClass ().getName ().equals ("java.lang.Object" )) {
243
+ content = "{}" ;
244
+ } else {
245
+ content = json .writeValueAsString (obj );
246
+ }
243
247
} catch (JsonProcessingException e ) {
244
248
throw new AlgoliaRuntimeException (e );
245
249
}
Original file line number Diff line number Diff line change @@ -23,9 +23,6 @@ public ObjectMapper build() {
23
23
mapper .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
24
24
mapper .enable (SerializationFeature .WRITE_ENUMS_USING_TO_STRING );
25
25
mapper .enable (DeserializationFeature .READ_ENUMS_USING_TO_STRING );
26
-
27
- // Allow defaulting a POST body property to an empty Object instance
28
- mapper .configure (SerializationFeature .FAIL_ON_EMPTY_BEANS , false );
29
26
return mapper ;
30
27
}
31
28
}
You can’t perform that action at this time.
0 commit comments