Open
Description
Description
Strings are not escaped when converting Java TypeQL to a query string, despite requiring escape characters in order for the query string to be valid.
It also appears that the required escape characters are inserted, rather than being removed during parsing of the query, and that this was an oversight during a bugfix for asymmetrical escaping behaviour in an older version of TypeQLpre 1.0).
The behaviour is not standard, can cause users to accidentally break their queries (when programmatically generating them) and prevents users from inserting any string.
Environment
- OS (where TypeQL server runs): any
- TypeQL version (and platform): any
- TypeQL client: any (most notable in client-java)
- Other environment details:
Reproducible Steps
Steps to create the smallest reproducible scenario:
1.
// Gives us an invalid TypeQL query
System.out.println(TypeQL.insert(TypeQL.var("x").isa("person").has("name", "b\"o\"b")).toString());
Expected Output
insert $x isa person, has name "b\"o\"b";
Actual Output
insert $x isa person, has name "b"o"b";