Skip to content

escape backslash in key values in elemToString#1084

Open
jmestwa-coder wants to merge 1 commit into
openconfig:masterfrom
jmestwa-coder:elemtostring-escape-backslash
Open

escape backslash in key values in elemToString#1084
jmestwa-coder wants to merge 1 commit into
openconfig:masterfrom
jmestwa-coder:elemtostring-escape-backslash

Conversation

@jmestwa-coder
Copy link
Copy Markdown

elemToString escapes = and ] in a PathElem key value but not the backslash that extractKV uses as its escape character, so the two disagree. A value like a\b serialized by PathToString re-parses to ab, and a trailing backslash lets one key absorb the next, so {k1:"a", k2:"b"} round-trips to a single k1="a][k2=b]". Escape the backslash first so PathToString output round-trips through StringToStructuredPath.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 88.728%. remained the same — jmestwa-coder:elemtostring-escape-backslash into openconfig:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants