-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Allow marshaling plain string values into JSON scalars #1743
Conversation
🤖 I have created a release *beep* *boop* --- ## [4.45.3](v4.45.2...v4.45.3) (2024-06-19) ### Bug Fixes * Allow marshaling plain string values into JSON scalars ([#1743](#1743)) ([87e90b8](87e90b8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Isn't a plain string not a valid JSON? Only a quoted one is a valid JSON? |
yes (as we check |
@@ -15,6 +21,7 @@ func TestJSONSet(t *testing.T) { | |||
{source: "{}", result: JSON{Value: []byte("{}"), Valid: true}}, | |||
{source: `"test"`, result: JSON{Value: []byte(`"test"`), Valid: true}}, | |||
{source: "1", result: JSON{Value: []byte("1"), Valid: true}}, | |||
{source: `json some data`, result: JSON{Value: []byte(`"json some data"`), Valid: true}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source value is an unquoted string so not sure why we're treating it as a valid JSON
But this PR makes it so that any unquoted string value is treated as a valid JSON no? |
Fixes https://github.com/cloudquery/cloudquery-issues/issues/1875