Skip to content

Commit 65d808a

Browse files
authored
Merge pull request #1512 from /issues/1510-unknown-properties-port
Fix #1510: OnboardingProcessConfigurationValueConverter should accept unknown properties (forward port)
2 parents cf21d93 + d5c328f commit 65d808a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

enrollment-server-onboarding-common/src/main/java/com/wultra/app/onboardingserver/common/database/entity/OnboardingProcessConfigurationValueConverter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package com.wultra.app.onboardingserver.common.database.entity;
1919

2020
import com.fasterxml.jackson.core.JsonProcessingException;
21+
import com.fasterxml.jackson.databind.DeserializationFeature;
2122
import com.fasterxml.jackson.databind.ObjectMapper;
2223
import jakarta.persistence.AttributeConverter;
2324
import jakarta.persistence.Converter;
@@ -30,7 +31,8 @@
3031
@Converter
3132
public class OnboardingProcessConfigurationValueConverter implements AttributeConverter<OnboardingProcessConfigurationValue, String> {
3233

33-
private final ObjectMapper objectMapper = new ObjectMapper();
34+
private final ObjectMapper objectMapper = new ObjectMapper()
35+
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
3436

3537
@Override
3638
public String convertToDatabaseColumn(OnboardingProcessConfigurationValue attribute) {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
INSERT INTO es_onboarding_process_configuration (id, process_type, config) VALUES
22
(1, 'reactivation', '{"enabled":true,"activationType":"CODE","otpForIdentification":true,"otpForIdentityVerification":true,"useTemporaryActivation":true,"approvalEnabled":true,"documents":{"totalRequiredDocumentsCount":2,"groups":[{"requiredDocumentsCount":1,"items":[{"type":"ID_CARD","sideCount":2},{"type":"PASSPORT","sideCount":1}]},{"requiredDocumentsCount":0,"items":[{"type":"DRIVING_LICENCE","sideCount":1}]}]}}'),
3-
(2, 'onboarding', '{}');
3+
(2, 'onboarding', '{"unknown": "value"}');

0 commit comments

Comments
 (0)