The simple answer is that JSON can't naturally represent a node that is both an intermediate one and a leaf one , unless you introduce some arbitrary convention for defining a "special" node that represents a value also held by an intermediate node.  There's no "standard" convention for this, since, from a JSON point of view,  such a situation doesn't make sense.

The way I've tackled this with the Node.js ewd-document-store module (http://gradvs1.mgateway.com/download/ewd-document-store.pdf) which abstracts global structures directly to JSON, is to provide not only a JSON mapping (via the getDocument() and setDocument() methods, but also have a read/write value property for any specified "DocumentNode".  If you use getDocument(), you'll not see any values for intermediate nodes, but separately you can home in on such nodes individually and access their data via its value property.

A DocumentNode's "exists", "hasValue"  and "hasChildren" boolean properties can be used to determine the nature of each node.  In truly JSON-mapped global structures, hasValue and hasChildren will be mutually exclusive, whereas it's quite feasible for (typically legacy) global structures to have DocumentNodes where both are true.

Ideally the solution is to never have global structures with data values for intermediate nodes, but typically the problem is a legacy one.

Native Mobile Cache-based app development is now possible in JavaScript using React Native and EWD 3.  For instructions, see https://groups.google.com/forum/#!topic/enterprise-web-developer-communi...

The benefits are huge: just one language (JavaScript) for front-end and back-end app development on all platforms, one development pattern for front-end UI development on both desktop and mobile platforms, and the opportunity to re-use the same back-end logic for desktop and mobile apps.  

Additionally, just like desktop browser-based apps, with EWD 3 and React Native, Mobile apps can use WebSockets instead of REST to access the back-end and Cache.