Open dgieselaar opened 2 months ago
Pinging @elastic/kibana-management (Team:Kibana Management)
This is a bug in the helper function splitDataIntoJsonObjects
in this file. The function is used to detect when there are several json objects in the Console editor, for example for bulk requests.
I think we could update the regex to not allow no whitespaces between the curly braces. It would make sense to maybe even force a new line between the braces:
// old regex
const jsonSplitRegex = /}\s*{/;
// new regex alternative 1
const jsonSplitRegex = /}\s+{/;
// new regex alternative 2
const jsonSplitRegex = /}\n{/;
HI @yuliacech , @alisonelizabeth and @dgieselaar, Changing the regex to /}\s+{/ requires at least one whitespace character between the braces, which should solve the immediate issue while still allowing for various whitespace formatting (spaces, tabs, newlines). If this is a valid solution, can you assign this issue to me?
Hi @dryruffian we have not investigated the issue yet, but if you'd like to work on it, please assign yourself and open a PR. We will gladly review and provide feedback. Thanks!
ok will doo thanks @alisonelizabeth
In some cases, when submitting a request with a certain pattern, console inserts a line break under the water which breaks the request, without a hint to the user as to why that has happened. Here's a snippet to reproduce:
The issue is with
{{remote}}{{data_stream.type}}
. If that is changed to{{remote}}-{{data_stream.type}}
, the request works again.