Escaping Quotes in TriggerBinding values #257
Labels
kind/question
Issues or PRs that are questions around the project or a particular feature
lifecycle/rotten
Denotes an issue or PR that has aged beyond stale and will be auto-closed.
What?
Today, if the Binding expression is a JSON string, we escape the double-quotes i.e. if the output is
{"a": "b"}
, we use{\"a\":\"b\"}
.Why do we do this?
From @ncskier :
I think it's because we're passing that JSON object as a type String in the ResourceTemplate JSON: https://github.com/tektoncd/triggers/blob/master/pkg/sink/sink.go#L195. So, we have to escape those quotes, otherwise they'll result in a JSON syntax error (however, there might be a better way to do this sweat_smile)
From: #241 (comment)
Ideas:
Keep doing this and document this as a behavior
Decide what to do depending on where the binding is being used i.e. if it is being appended to a string, escape it otherwise not i.e.
The text was updated successfully, but these errors were encountered: