Merge branch '1.4.x'
This commit is contained in:
@@ -16,7 +16,7 @@ jobs:
|
||||
name: Update on Supported Branches
|
||||
strategy:
|
||||
matrix:
|
||||
branch: [ '1.3.x', 'main' ]
|
||||
branch: [ '1.3.x', '1.4.x', 'main' ]
|
||||
steps:
|
||||
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@e28269199d1d27975cf7f65e16d6095c555b3cd0 # v0.0.20
|
||||
name: Update
|
||||
|
||||
@@ -136,6 +136,12 @@ public final class ArgumentValue<T> {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String v = ((this.value != null) ? this.value.toString() : (this.omitted) ? "omitted" : "empty");
|
||||
return "ArgumentValue[" + v + "]";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Static factory method for an argument value that was provided, even if
|
||||
|
||||
@@ -158,13 +158,14 @@ public abstract class QuerydslDataFetcher<T> {
|
||||
@Nullable String prefix, Map<String, Object> arguments, MultiValueMap<String, Object> parameters) {
|
||||
|
||||
for (Map.Entry<String, Object> entry : arguments.entrySet()) {
|
||||
String key = ((prefix != null) ? prefix + "." : "") + entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
if (value instanceof Map<?, ?> nested) {
|
||||
addParameters(entry.getKey(), (Map<String, Object>) nested, parameters);
|
||||
addParameters(key, (Map<String, Object>) nested, parameters);
|
||||
continue;
|
||||
}
|
||||
List<Object> values = (value instanceof List) ? (List<Object>) value : Collections.singletonList(value);
|
||||
parameters.put(((prefix != null) ? prefix + "." : "") + entry.getKey(), values);
|
||||
parameters.put(key, values);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,4 +80,10 @@ class ArgumentValueTests {
|
||||
assertThat(called.get()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void toStringValue() {
|
||||
assertThat(ArgumentValue.omitted()).hasToString("ArgumentValue[omitted]");
|
||||
assertThat(ArgumentValue.ofNullable(null)).hasToString("ArgumentValue[empty]");
|
||||
assertThat(ArgumentValue.ofNullable("hello")).hasToString("ArgumentValue[hello]");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user