Skip to content

Commit

Permalink
fix(core): Explicitly create ObjectMapper (#235)
Browse files Browse the repository at this point in the history
This avoids a potential runtime issue wherein there are 3 or more
different object mappers to choose from.
  • Loading branch information
ajordens authored Jun 18, 2018
1 parent 6635f01 commit 64bc33d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.netflix.spinnaker.fiat.config;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.spectator.api.Registry;
import com.netflix.spinnaker.kork.jedis.RedisClientDelegate;
Expand All @@ -37,13 +39,16 @@ Clock clock() {
@Bean
LockManager redisLockManager(Clock clock,
Registry registry,
ObjectMapper mapper,
RedisClientDelegate redisClientDelegate) {
ObjectMapper objectMapper = new ObjectMapper()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.setSerializationInclusion(JsonInclude.Include.NON_NULL);

return new RedisLockManager(
null, // will fall back to running node name
clock,
registry,
mapper,
objectMapper,
redisClientDelegate,
Optional.empty(),
Optional.empty()
Expand Down

0 comments on commit 64bc33d

Please sign in to comment.