Closed kopyl closed 5 months ago
Multiline strings (triple-quoted strings) in Python still process escape sequences; they are not raw strings. So the escaped double quote of your input is being unescaped by Python when you define the results_json
value, before jsonnet even sees it.
You can use a raw string (prefixed by r
) instead to prevent this and get the expected result:
results_json = r"""{
title: "\"Picnic collective\" logo and characters",
}"""
results = _jsonnet.evaluate_snippet('snippet', results_json)
@johnbartholomew thank you very much, this works :)
Thanks. Closing as resolved.
This library can't decode JSON objects which have escaped double quotes.
And you get this error: