Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion jsonpointer.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,13 @@ def set(self, doc, value, inplace=True):

if isinstance(parent, Sequence) and part == '-':
parent.append(value)
elif isinstance(parent, str):
raise JsonPointerException("Cannot set value in a string")
Comment thread
stefankoegl marked this conversation as resolved.
Outdated
else:
parent[part] = value
try:
parent[part] = value
except (TypeError, IndexError) as e:
raise JsonPointerException("Invalid assignment target: %s" % (e,))
Comment on lines +217 to +220

return doc

Expand Down