Skip to content

Commit 91ce0f4

Browse files
committed
🚑 Fix final fields not considered in YAML configurations
1 parent 53d7b83 commit 91ce0f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

api/src/main/java/net/transferproxy/api/util/ResourceUtil.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
package net.transferproxy.api.util;
2626

2727
import org.jetbrains.annotations.NotNull;
28+
import tools.jackson.databind.MapperFeature;
2829
import tools.jackson.databind.ObjectMapper;
2930
import tools.jackson.databind.PropertyNamingStrategies;
3031
import tools.jackson.dataformat.yaml.YAMLMapper;
@@ -38,8 +39,10 @@
3839

3940
public final class ResourceUtil {
4041

41-
private static final ObjectMapper DEFAULT_MAPPER =
42-
YAMLMapper.builder().propertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE).build();
42+
private static final ObjectMapper DEFAULT_MAPPER = YAMLMapper.builder()
43+
.configure(MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS, true)
44+
.propertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE)
45+
.build();
4346

4447
private ResourceUtil() throws IllegalAccessException {
4548
throw new IllegalAccessException("You cannot instantiate a utility class");

0 commit comments

Comments
 (0)