Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3643

decoding json changing value and encoding in scala

$
0
0

I have this

request                  .get(uri"$configurationEndpoint")                  .header("Authorization", s"Bearer $token")                  .send(backend)                  .flatMap(configurationResponse => {                    if (configurationResponse.code.equals(StatusCode.Ok)) {                      decode[Json](configurationResponse.body) match {                        case Right(value) => updatedJson = value.copy(bulkApi = true)

As you see, what I want to do is take the original json sent except I add a value if it doesn't exist or change it, how can I do this?

I have tried a few things such as the following but it did not work

value.deepMerge(Json.obj("bulkApi" -> bulkApi))

Viewing all articles
Browse latest Browse all 3643

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>