Raw JSON string as field value
See original GitHub issueI have a large JSON string data field. I want to return this json string asis without first deserializing it to a python object, and serialize back when it gets sent out. What is the best way to do this?
I saw the JSONString
type, but not sure if that is intended for this use. Note that I don’t need type checking on this field. Just want to return the string as JSON data object without the overhead of deserialization and serialization.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Raw string field value in JSON file - Stack Overflow
A workaround for the lack of raw string support in JSON is to Base64 encode your string before adding it to your JSON....
Read more >How to handle stringified raw JSON data using JSON Parser?
If a key in your raw JSON data has the value of a string , the syntax should be "A": "" . This...
Read more >Using @JsonRawValue to serialize property as it is - LogicBig
@JsonRawValue annotation can be used to serialize property as it is. The value is not escaped or quoted. This can be useful in...
Read more >JSON - HTTPie 3.2.1 (latest) docs
Non-string JSON fields use the := separator, which allows you to embed arbitrary JSON data into the resulting JSON object. Additionally, text and...
Read more >How to look at the raw string value of a JSON? : r/elm - Reddit
I'm trying to use Browser.Events.onKeyUp , that wants to be passed a JSON decoder as its argument. To write the decoder, I'd like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ProjectCheshire kindly offered this example that allows one to override the serialization logic:
Hey @jkimbo! Thanks for your reply!
I consider this to be a problem on the serving-side, as an implementation detail behind the graphQL schema.
Suppose I have a large JSON string (5MB) that is read from postgreSQL. Deserializing it into python object, then serialize back is unnecessary. Would be nice if we could
__insertUnsafeJson__
into the final graphQL response.