Skip to content

[set] Set should error when it cannot correctly marshal JSON#38

Merged
cacoco merged 1 commit intomainfrom
setFixes
Feb 7, 2024
Merged

[set] Set should error when it cannot correctly marshal JSON#38
cacoco merged 1 commit intomainfrom
setFixes

Conversation

@cacoco
Copy link
Copy Markdown
Owner

@cacoco cacoco commented Feb 7, 2024

Problem

Right now when set cannot marshal the incoming string data into an object or array
it treats the result as a string, However, it should fail for malformed JSON rather
than allowing the malformed JSON to be added as a string value for the given
property key.

Solution

Fail if the marshaling fails when the string starts with either a { or a [ indicating that
the input string should be a JSON object or array respectively.

Result

Better error signaling to users when invalid JSON is given.

@cacoco cacoco added this to the v0.48.0 milestone Feb 7, 2024
@cacoco cacoco self-assigned this Feb 7, 2024
@cacoco cacoco merged commit eacf801 into main Feb 7, 2024
@cacoco cacoco deleted the setFixes branch February 7, 2024 02:54
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.

1 participant