question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow fields to be json literals

See original GitHub issue
In the jclouds project, we often encounter semi-structured data.  For example, 
the structure is known to a certain depth, and after which we'd like to defer 
parsing to an extension.

For example, a json schema could be known to have attributes, which are not 
typed.  We'd like to defer parsing of these attributes.

For example, I'd like to parse the following:

{
    "name": "elmo",
    "attributes": {
        "custom/1": {
            "favorite": "berries"
        },
        "custom/2": 1000
    }
}

into a class like this:

class Thing {
    String name;
    Map<String, String> attributes; 
}

Original issue reported on code.google.com by adrian.f...@gmail.com on 15 May 2011 at 12:28

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
GoogleCodeExportercommented, Mar 19, 2015
here's a valid workaroud:

https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/js
on/internal/NullHackJsonLiteralAdapter.java
https://github.com/jclouds/jclouds/blob/master/core/src/test/java/org/jclouds/js
on/internal/NullHackJsonLiteralAdapterTest.java

Thanks tons for the help!

Original comment by adrian.f...@gmail.com on 2 Jan 2012 at 10:51

0reactions
GoogleCodeExportercommented, Mar 19, 2015
okie.  just sent offline mail. thx

Original comment by fernc...@gmail.com on 2 Jan 2012 at 5:51

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Object Literals - W3Schools
JSON object literals contains key/value pairs. Keys and values are separated by a colon. Keys must be strings, and values must be a...
Read more >
Are multi-line strings allowed in JSON? - Stack Overflow
Newlines are "control characters" so, no, you may not have a literal ... JSON does not allow "real" newlines in its data; it...
Read more >
Working with JSON data in Google Standard SQL | BigQuery
By ingesting JSON data as a JSON data type, BigQuery can encode and process each JSON field individually. You can then query the...
Read more >
Working with JSON - Learn web development | MDN
In this article, we've given you a simple guide to using JSON in your programs, including how to create and parse JSON, and...
Read more >
JSON methods, toJSON - The Modern JavaScript Tutorial
Let's say we have a complex object, and we'd like to convert it into a string, to send it over a network, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found