提交 4021d239 编写于 作者: S Sebastien Deleuze

Fix JsonObjectDecoder with '[' starting chunk

Issue: SPR-15013
上级 b70071fd
......@@ -212,9 +212,6 @@ class JsonObjectDecoder extends AbstractDecoder<DataBuffer> {
}
}
if (this.input.readableBytes() == 0) {
this.index = 0;
}
return Flux.fromIterable(chunks);
}
......
......@@ -106,6 +106,19 @@ public class JsonObjectDecoderTests extends AbstractDataBufferAllocatingTestCase
.expectNext("{\"foo\": \"baz\"}")
.expectComplete()
.verify();
// SPR-15013
source = Flux.just(stringBuffer("["), stringBuffer("{\"id\":1,\"name\":\"Robert\"}"),
stringBuffer(","), stringBuffer("{\"id\":2,\"name\":\"Raide\"}"),
stringBuffer(","), stringBuffer("{\"id\":3,\"name\":\"Ford\"}"),
stringBuffer("]"));
output = decoder.decode(source, null, null, Collections.emptyMap()).map(JsonObjectDecoderTests::toString);
StepVerifier.create(output)
.expectNext("{\"id\":1,\"name\":\"Robert\"}")
.expectNext("{\"id\":2,\"name\":\"Raide\"}")
.expectNext("{\"id\":3,\"name\":\"Ford\"}")
.expectComplete()
.verify();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册