0
I have an object with settings that return from a server in the following format:
{
"example-url": "http://examples.com",
"example2-url": "${example-url}/examples",
"example3-url": "${example-url}/ex",
"example4-url": "${example2-url}/teste"
}
Wanted to replace the strings with their respective values contained inside the object, thus staying:
{
"example-url": "http://examples.com",
"example2-url": "http://examples.com/examples",
"example3-url": "http://examples.com/ex",
"example4-url": "http://examples.com/examples/teste"
}
How do I map the object and give replace ?
My first question is: Does the server really have to return this result? what is the reason behind this logic? can you change the server?
– Sergio
@Sergio Sim, the server needs to return the object in this format, as it is used in other applications. It was made this way because it is a Spring Cloud Config.
– Jonathan Barcela
I assume you’re missing
"
in your initial object, both answers below took that assumption.– Sergio
Corrected, @Sergio. Thanks for pointing.
– Jonathan Barcela