This commit is contained in:
Rossen Stoyanchev
2019-07-02 09:30:06 +01:00
parent 27b5d2b288
commit 29b7659094
2 changed files with 24 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -96,15 +96,12 @@ public class RequestPartMethodArgumentResolver extends AbstractMessageReaderArgu
ReactiveAdapter adapter = getAdapterRegistry().getAdapter(parameter.getParameterType());
if (adapter != null) {
// Mono<Part> or Flux<Part>
MethodParameter elementType = parameter.nested();
if (Part.class.isAssignableFrom(elementType.getNestedParameterType())) {
return Mono.just(adapter.fromPublisher(parts));
}
return Mono.just(adapter.fromPublisher(decodePartValues(parts, elementType, bindingContext, exchange, isRequired)));
return Mono.just(adapter.fromPublisher(
Part.class.isAssignableFrom(elementType.getNestedParameterType()) ?
parts : decodePartValues(parts, elementType, bindingContext, exchange, isRequired)));
}
// <T> or Mono<T>
return decodePartValues(parts, parameter, bindingContext, exchange, isRequired)
.next().cast(Object.class);
}