You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I replace mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); with mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
I use my own http client with the mapper and the jeon model class
and with /_matrix/client/r0/keys/query, i had a bad request with NON_EMPTY because the serialization removes my empty list:
The Java object:
QueryRequest keysQuery = new QueryRequest(); keysQuery.setTimeout(5000L); Map<String, List<String>> devicesKeysRequest = new HashMap<>(); devicesKeysRequest.put(bobLogin.getUserId(), Collections.emptyList()); keysQuery.setDeviceKeys(devicesKeysRequest);
Serialized Json with NON_EMPTY => bad request: {"timeout":5000}
Serialized Json with NON_NULL => good request: {"timeout":5000,"device_keys":{"@a66bf63f-d9bc-41d1-99ce-467c2af61c26:matrix.docker.localhost":[]}}
In Matrix spec for /_matrix/client/r0/keys/query:
device_keys : {string: [string]} | Required. The keys to be downloaded. A map from user ID, to a list of device IDs, or to an empty list to indicate all devices for the corresponding user.
The text was updated successfully, but these errors were encountered:
jmsdk/jackson-support/src/main/java/io/github/ma1uta/matrix/support/jackson/DefaultObjectMapperProvider.java
Line 41 in f159926
I replace
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
withmapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
I use my own http client with the mapper and the jeon model class
and with
/_matrix/client/r0/keys/query
, i had a bad request with NON_EMPTY because the serialization removes my empty list:The Java object:
QueryRequest keysQuery = new QueryRequest(); keysQuery.setTimeout(5000L); Map<String, List<String>> devicesKeysRequest = new HashMap<>(); devicesKeysRequest.put(bobLogin.getUserId(), Collections.emptyList()); keysQuery.setDeviceKeys(devicesKeysRequest);
Serialized Json with NON_EMPTY => bad request:
{"timeout":5000}
Serialized Json with NON_NULL => good request:
{"timeout":5000,"device_keys":{"@a66bf63f-d9bc-41d1-99ce-467c2af61c26:matrix.docker.localhost":[]}}
In Matrix spec for
/_matrix/client/r0/keys/query
:device_keys : {string: [string]} | Required. The keys to be downloaded. A map from user ID, to a list of device IDs, or to an empty list to indicate all devices for the corresponding user.
The text was updated successfully, but these errors were encountered: