Skip to main content

parse_assignment

Function parse_assignment 

Source
pub fn parse_assignment(raw: &str) -> Result<(String, Value), String>
Expand description

Parse a key=value or key:=json pair from --set.

key=value guesses: the value is read as JSON when it parses as one, so --set storyPoints=3 sends a number and --set tags=["a","b"] sends an array, and anything else is a string. Guessing from the queue’s field metadata instead would cost a request on every update to answer a question the caller already knows.

The cost of the guess is that a summary which happens to look like a number becomes one. key:=json is the way to say what was meant: the value is JSON and only JSON, so --set 'summary:="3"' writes the string and invalid JSON is a refusal rather than a silent fall back to text.