-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Julien Hoarau opened SPR-16166 and commented
WebClient failed to convert a json response containing a top level JsonValue (true, false, null, NUMBER ) (Valid Json according to ECMA-404)
Simple code example for demonstration
package com.atlassian.product.fabric.tasksdecisions.rest;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
@RestController
public class JsonValueResource {
@GetMapping("/fail")
public Mono<Boolean> fail() {
return WebClient.builder().baseUrl("http://localhost:8000")
.build().get().uri("/")
.accept(MediaType.APPLICATION_JSON)
.retrieve()
.bodyToMono(Boolean.class)
.switchIfEmpty(Mono.error(new RuntimeException("No response")));
}
@GetMapping
Mono<Boolean> jsonValueBoolean() {
return Mono.just(true);
}
}Jackson2Tokenizer seems to only return tokens if they are in an object or array.
Affects: 5.0.1
Issue Links:
- Spring WebFlux (Netty/Jackson) treats Mono<Integer> and Mono<String> differently [SPR-16222] #20770 Spring WebFlux (Netty/Jackson) treats Mono and Mono differently ("is duplicated by")
- Support array of scalar values in Jackson2Tokenizer [SPR-16407] #20953 Support array of scalar values in Jackson2Tokenizer
Referenced from: pull request #1602, and commits 8e253a3
1 votes, 3 watchers
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug