Skip to content

Commit

Permalink
Jackson mapper support no constructors on classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicwest committed Nov 27, 2023
1 parent 6020301 commit e46926f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package gov.cabinetoffice.gap.adminbackend.config;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -19,7 +21,7 @@ public ObjectMapper getObjectMapper() {
objectMapper.disable(DEFAULT_VIEW_INCLUSION);
objectMapper.disable(FAIL_ON_UNKNOWN_PROPERTIES);
objectMapper.registerModule(new JavaTimeModule());
objectMapper.registerModule(new ParameterNamesModule(JsonCreator.Mode.PROPERTIES));
return objectMapper;
}

}

0 comments on commit e46926f

Please sign in to comment.