Decouple XContentGenerator and JsonXContentGenerator from BytesReference (elastic/x-pack-elasticsearch#4009)
This is the x-pack side of
Original commit: elastic/x-pack-elasticsearch@42f5784232158b061789ea2c227d3fd2176005ac
@@ -138,7 +138,7 @@ public class PreviewDatafeedAction extends Action<PreviewDatafeedAction.Request,
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
- builder.rawValue(preview, XContentType.JSON);
+ builder.rawValue(preview.streamInput(), XContentType.JSON);
return builder;
}
