Ability to selectively allow quoting / no quoting in UTF8JsonGenerator#writeRawUTF8String #1410
Unanswered
StevenCurran
asked this question in
Q&A
Replies: 1 comment 5 replies
-
No, unfortunately there is no way to do that. There are a few One final possibility to see might be:
where custom implementation of |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, have a use case where I am pulling json payloads from an external store, and passing them into another built json payload that is created from a json generator. The payload that I want to write, is a byte[] of an existing json string.
Using this method in the UTF8JsonGenerator it ends up surrounding the string with additional quotes.
What I want to know, is there a way for me to selectively disable this quoting (i need it in other places though, so i want to reenable it for other parts of the json payload I am creating with the generator).
I have monkey patched this class locally like this, but obviously its not ideal and would rather be able to do it from the library, so if there are any other approaches to solving this I would love to know!
This is in a pretty memory constrained setting, so trying to avoid all unnecessary string / byte[] allocs as much as possible.
Alternative is a way to access the com.fasterxml.jackson.core.json.UTF8JsonGenerator#_writeBytes(byte[], int, int) method, as this is essentially what I want to call:
So I want to achieve what this patched version is doing.
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions