ensure json deserialization works for array based items when create a new application user.
This commit is contained in:
+4
-4
@@ -748,8 +748,8 @@ public class ApiDataConversionServiceImpl implements ApiDataConversionService {
|
|||||||
throw new InvalidJsonException();
|
throw new InvalidJsonException();
|
||||||
}
|
}
|
||||||
|
|
||||||
Type typeOfMap = new TypeToken<Map<String, String>>(){}.getType();
|
Type typeOfMap = new TypeToken<Map<String, Object>>(){}.getType();
|
||||||
Map<String, String> requestMap = gsonConverter.fromJson(json, typeOfMap);
|
Map<String, Object> requestMap = gsonConverter.fromJson(json, typeOfMap);
|
||||||
|
|
||||||
Set<String> supportedParams = new HashSet<String>(
|
Set<String> supportedParams = new HashSet<String>(
|
||||||
Arrays.asList("username", "firstname", "lastname", "password", "repeatPassword", "email", "officeId", "notSelectedRoles", "roles")
|
Arrays.asList("username", "firstname", "lastname", "password", "repeatPassword", "email", "officeId", "notSelectedRoles", "roles")
|
||||||
@@ -1161,10 +1161,10 @@ public class ApiDataConversionServiceImpl implements ApiDataConversionService {
|
|||||||
return paramValue;
|
return paramValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long extractLongParameter(final String paramName, final Map<String, String> requestMap, final Set<String> modifiedParameters) {
|
private Long extractLongParameter(final String paramName, final Map<String, ?> requestMap, final Set<String> modifiedParameters) {
|
||||||
Long paramValue = null;
|
Long paramValue = null;
|
||||||
if (requestMap.containsKey(paramName)) {
|
if (requestMap.containsKey(paramName)) {
|
||||||
String valueAsString = requestMap.get(paramName);
|
String valueAsString = (String) requestMap.get(paramName);
|
||||||
if (StringUtils.isNotBlank(valueAsString)) {
|
if (StringUtils.isNotBlank(valueAsString)) {
|
||||||
paramValue = Long.valueOf(Double.valueOf(valueAsString).longValue());
|
paramValue = Long.valueOf(Double.valueOf(valueAsString).longValue());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user