if (type == null) {
return Variables.untypedValue(value);
}
ValueType valueType = valueTypeResolver.typeForName(fromRestApiTypeName(type));
if(valueType == null) {
throw new RestException(Status.BAD_REQUEST, String.format("Unsupported value type '%s'", type));
}
else {
if(valueType instanceof PrimitiveValueType) {