You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getPredicate method to return null. The method will actually still return null when unrelated (to the entity) query params are used in the URL.
for example calling the following url /api/test results in correct behavior, but when calling /api/test?idontexistasproperty=true will result in a "null" Predicate in the controller method.
Proposed fix:
@NullablepublicPredicategetPredicate(TypeInformation<?> type, MultiValueMap<String, String> values,
QuerydslBindingsbindings) {
Assert.notNull(bindings, "Context must not be null!");
BooleanBuilderbuilder = newBooleanBuilder();
if (values.isEmpty()) {
returnbuilder;
}
for (Entry<String, List<String>> entry : values.entrySet()) {
if (isSingleElementCollectionWithoutText(entry.getValue())) {
continue;
}
Stringpath = entry.getKey();
if (!bindings.isPathAvailable(path, type)) {
continue;
}
PathInformationpropertyPath = bindings.getPropertyPath(path, type);
if (propertyPath == null) {
continue;
}
Collection<Object> value = convertToPropertyPathSpecificType(entry.getValue(), propertyPath);
Optional<Predicate> predicate = invokeBinding(propertyPath, bindings, value);
predicate.ifPresent(builder::and);
}
// return builder when it doens't have a valuereturnbuilder.hasValue() ? builder.getValue() : builder;
}
Affects: 2.0.10 (Kay SR10), 2.1 GA (Lovelace)
The text was updated successfully, but these errors were encountered:
Lars van der Vliet opened DATACMNS-1398 and commented
For issue https://jira.spring.io/browse/DATACMNS-1168 a check is added to prevent the
getPredicate method to return null. The method will actually still return null when unrelated (to the entity) query params are used in the URL.
for example calling the following url /api/test results in correct behavior, but when calling /api/test?idontexistasproperty=true will result in a "null" Predicate in the controller method.
Proposed fix:
Affects: 2.0.10 (Kay SR10), 2.1 GA (Lovelace)
The text was updated successfully, but these errors were encountered: