Closed AshkanKiafard closed 3 months ago
But when we try to set empire to null via Swagger, it works.
We found the cause.
In MainModule you should comment this line .setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
@Provides
@Singleton
ObjectMapper mapper() {
return new ObjectMapper()
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
// .setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
.enable(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT);
}
Describe the bug We have a member of a game with an (non null) empire and when we try to patch this member and set its empire to null, we send a updateMemeberDTO containing a null empire but the server doesn't overwrite the current empire and the response with server contains the old non null empire.
To Reproduce Steps to reproduce the behavior:
Expected behavior Server should give a response back, that has empire as null.
Additional context We want to set the players without empires as spectators but because of this problem, we can't.