Suppose I have a data model, for example:
public class MyModel { private String someString; private String someJson;
I serve the model through the REST API (Jersey) for the client. I know that I could marshal / untie this with something like:
{ "someStrong": "foo", "someJson": "{ someClientThing: \"bar\", someOtherClientThing: \"baz\"}" }
But I'm looking for something cleaner. Is there a way that I can marshal / unmarshal that for JSON like this?
{ someStrong: "foo", someJson: { someClientThing: "bar", someOtherClientThing: "baz" } }
I do not want the server to be aware of the data model for someJson , since it belonged to the client. I just want the server to handle persistence - so the server will pass it back and forth between the client and the database.
Note. . It is not necessary to directly match a string with an integer if it can display something unstructured (not statically defined on the server), which can be compressed to persistence (and unstructured back to this unstructured object when searching).
source share