Karate: How To Convert Object/map In String From Javascript To Java?
I Have a file json named production_2.json [ { 'v':{ 'id':'rep_01564526', 'name':'tuttoverde.pgmx', 'type':'PRODUCTION_STARTED', 'ute':'CDL',
Solution 1:
You are doing some really advanced stuff in Karate. I strongly suggest you start looking at the new version (close to release) and you can find details here: https://github.com/intuit/karate/wiki/1.0-upgrade-guide
The reason is because the async and Java interop has some breaking changes - and there are some new API-s you can call on the karate
object in JS to do format conversions:
var temp = karate.fromString(payload);
And karate.log()
should work better and not give you that odd formatting you are complaining about. With the current version you can try karate.toJson()
if that gives you the conversion you expect.
Given your advanced usage, I recommend you start using the new version and provide feedback on anything that may be still needed.
Post a Comment for "Karate: How To Convert Object/map In String From Javascript To Java?"