I have string like:
String metadata = "{ Item: {Owner:John, About:{website:www.john.com/about, firstName:William, lastName:Shakespeare, date:1/2/2000, books:[Othello, R&J], shelf:[12/3/4, 14/5/6, 17/8/6]}}}"
I want to convert this metadata into JSON format. But because of missing quotes I was not able to convert it.
I can write a code that could do parsing and add quotes, that does not becomes flexible for any string to make it into JSON. (Since this metadata is prone to changes in future).
Is there a way to add quotes to any string to make it into JSON?
Or how can be this generalized so that simple string is converted into JSON. Do we have any library in Java that converts?
Code snippets will be really helpful to understand, if no library is there.
Well, I prefer not to use any external library.