Revise how bodyType is set for 7.0 codebase
See gh-34793
This commit is contained in:
parent
fed6e9b3c3
commit
d8503daa1f
|
@ -75,18 +75,19 @@ public class HttpRequestValues {
|
|||
|
||||
private final @Nullable Object bodyValue;
|
||||
|
||||
private @Nullable ParameterizedTypeReference<?> bodyValueType;
|
||||
private final @Nullable ParameterizedTypeReference<?> bodyValueType;
|
||||
|
||||
|
||||
/**
|
||||
* Construct {@link HttpRequestValues}.
|
||||
* @since 6.1
|
||||
* @since 7.0
|
||||
*/
|
||||
protected HttpRequestValues(@Nullable HttpMethod httpMethod,
|
||||
@Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory,
|
||||
@Nullable String uriTemplate, Map<String, String> uriVariables,
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies, @Nullable Object version,
|
||||
Map<String, Object> attributes, @Nullable Object bodyValue) {
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies,
|
||||
@Nullable Object version, Map<String, Object> attributes,
|
||||
@Nullable Object bodyValue, @Nullable ParameterizedTypeReference<?> bodyValueType) {
|
||||
|
||||
Assert.isTrue(uri != null || uriTemplate != null, "Neither URI nor URI template");
|
||||
|
||||
|
@ -100,6 +101,7 @@ public class HttpRequestValues {
|
|||
this.version = version;
|
||||
this.attributes = attributes;
|
||||
this.bodyValue = bodyValue;
|
||||
this.bodyValueType = bodyValueType;
|
||||
}
|
||||
|
||||
|
||||
|
@ -511,14 +513,9 @@ public class HttpRequestValues {
|
|||
Map<String, Object> attributes = (this.attributes != null ?
|
||||
new HashMap<>(this.attributes) : Collections.emptyMap());
|
||||
|
||||
HttpRequestValues requestValues = createRequestValues(
|
||||
return createRequestValues(
|
||||
this.httpMethod, uri, uriBuilderFactory, uriTemplate, uriVars,
|
||||
headers, cookies, this.version, attributes, bodyValue);
|
||||
|
||||
// In 6.2.x only, temporarily work around protected methods
|
||||
requestValues.bodyValueType = this.bodyValueType;
|
||||
|
||||
return requestValues;
|
||||
headers, cookies, this.version, attributes, bodyValue, this.bodyValueType);
|
||||
}
|
||||
|
||||
protected boolean hasParts() {
|
||||
|
@ -557,18 +554,18 @@ public class HttpRequestValues {
|
|||
|
||||
/**
|
||||
* Create {@link HttpRequestValues} from values passed to the {@link Builder}.
|
||||
* @since 6.1
|
||||
* @since 7.0
|
||||
*/
|
||||
protected HttpRequestValues createRequestValues(
|
||||
@Nullable HttpMethod httpMethod,
|
||||
@Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate,
|
||||
Map<String, String> uriVars,
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies, @Nullable Object version,
|
||||
Map<String, Object> attributes, @Nullable Object bodyValue) {
|
||||
Map<String, String> uriVars, HttpHeaders headers, MultiValueMap<String, String> cookies,
|
||||
@Nullable Object version, Map<String, Object> attributes,
|
||||
@Nullable Object bodyValue, @Nullable ParameterizedTypeReference<?> bodyValueType) {
|
||||
|
||||
return new HttpRequestValues(
|
||||
this.httpMethod, uri, uriBuilderFactory, uriTemplate,
|
||||
uriVars, headers, cookies, version, attributes, bodyValue);
|
||||
uriVars, headers, cookies, version, attributes, bodyValue, bodyValueType);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,12 +50,16 @@ public final class ReactiveHttpRequestValues extends HttpRequestValues {
|
|||
@Nullable HttpMethod httpMethod,
|
||||
@Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory,
|
||||
@Nullable String uriTemplate, Map<String, String> uriVars,
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies, @Nullable Object version,
|
||||
Map<String, Object> attributes,
|
||||
@Nullable Object bodyValue, @Nullable Publisher<?> body,
|
||||
@Nullable ParameterizedTypeReference<?> elementType) {
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies,
|
||||
@Nullable Object version, Map<String, Object> attributes,
|
||||
@Nullable Object bodyValue, @Nullable ParameterizedTypeReference<?> bodyValueType,
|
||||
@Nullable Publisher<?> body, @Nullable ParameterizedTypeReference<?> elementType) {
|
||||
|
||||
super(httpMethod,
|
||||
uri, uriBuilderFactory, uriTemplate, uriVars,
|
||||
headers, cookies, version, attributes,
|
||||
bodyValue, bodyValueType);
|
||||
|
||||
super(httpMethod, uri, uriBuilderFactory, uriTemplate, uriVars, headers, cookies, version, attributes, bodyValue);
|
||||
this.body = body;
|
||||
this.bodyElementType = elementType;
|
||||
}
|
||||
|
@ -237,12 +241,13 @@ public final class ReactiveHttpRequestValues extends HttpRequestValues {
|
|||
@Nullable HttpMethod httpMethod,
|
||||
@Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory,
|
||||
@Nullable String uriTemplate, Map<String, String> uriVars,
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies, @Nullable Object version,
|
||||
Map<String, Object> attributes, @Nullable Object bodyValue) {
|
||||
HttpHeaders headers, MultiValueMap<String, String> cookies,
|
||||
@Nullable Object version, Map<String, Object> attributes,
|
||||
@Nullable Object bodyValue, @Nullable ParameterizedTypeReference<?> bodyValueType) {
|
||||
|
||||
return new ReactiveHttpRequestValues(
|
||||
httpMethod, uri, uriBuilderFactory, uriTemplate, uriVars,
|
||||
headers, cookies, version, attributes, bodyValue, this.body, this.bodyElementType);
|
||||
headers, cookies, version, attributes, bodyValue, bodyValueType, this.body, this.bodyElementType);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue