Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow backquoted string (based on ES6 template string) #719

Open
yairlenga opened this issue Oct 12, 2021 · 3 comments
Open

Allow backquoted string (based on ES6 template string) #719

yairlenga opened this issue Oct 12, 2021 · 3 comments
Labels
pr-needed Feature request for which PR likely needed (no active development but idea is workable)

Comments

@yairlenga
Copy link

yairlenga commented Oct 12, 2021

Suggesting adding an option to the JSON PARSER to allow backquoted string, based on ES6 template string.

The main benefit will be simplified way to enter multi line strings. It will allow (for most cases) to copy paste data from external documents, without having to edit the constant by adding ‘\’ before every new line, etc. likewise editing of such strings is significantly easier for users, and code.

example:

 { foo: \`with backquoted string
Easy to see line breakdown,
Enter escapes \n and \t
And use quote ‘ and “
` } 

abive string using standard json in difficult to maintain.

to emphasize, I do not suggest in this ticket that support will be included for placeholders ($(expression), tagged strings, sinterpolation. This can be a follow ( and very useful) extensions.

to support the argument, I want to highlight Jackson already support most of EC6 grammar; extra comma, unquoted identifiers and more.

@cowtowncoder
Copy link
Member

Ok, if anyone has time & itch, such feature could be enabled with JsonReadFeature setting (disabled by default).
Amount of work would probably be sizable, to support with all 4 backends (InputStream, Reader, DataInput & async readers).

@cowtowncoder cowtowncoder added the pr-needed Feature request for which PR likely needed (no active development but idea is workable) label Jun 20, 2022
@pjfanning
Copy link
Member

This seems pretty similar to #612 - which already works if you set the right features on the mapper. Backticks are not supported though.

@cowtowncoder
Copy link
Member

Right, these seem similar/related. Neither implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-needed Feature request for which PR likely needed (no active development but idea is workable)
Projects
None yet
Development

No branches or pull requests

3 participants