Skip to content
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

ENG-22892 fix: UnmarshalRawMessage of a gql quoted string #153

Merged
merged 3 commits into from
Sep 28, 2023

Conversation

jabielecki
Copy link
Contributor

(Fix idea suggested by @jarrodb)

Bug with this GQL schema: json: JSON!
and with the input json: "json quotes strings"

Output is wrong: json.RawMessage("json quotes strings")
For example this always fails:

var res any
json.Unmarshal(json.RawMessage("json quotes strings"), &res)
// invalid character 'j' looking for beginning of value

Correcting to: json.RawMessage("\"json quotes strings\"")

@jabielecki jabielecki requested a review from a team as a code owner September 20, 2023 16:19
Signed-off-by: Jakub Bielecki <47531708+jabielecki@users.noreply.github.com>
Bug with a GQL schema: `json: JSON!`
and with the input `json: "json quotes strings"`

Output is wrong: json.RawMessage("json quotes strings")
For example this always fails:

```
var res any
json.Unmarshal(json.RawMessage("json quotes strings"), &res)
```

Correcting to:   json.RawMessage("\"json quotes strings\"")

Signed-off-by: Jakub Bielecki <47531708+jabielecki@users.noreply.github.com>
Signed-off-by: Jakub Bielecki <47531708+jabielecki@users.noreply.github.com>
@jabielecki jabielecki changed the title fix: UnmarshalRawMessage of a gql quoted string ENG-22892 fix: UnmarshalRawMessage of a gql quoted string Sep 26, 2023
@nicolerenee
Copy link
Member

For some additional testing I pulled this branch into a local copy of load-balancer-api and ran through the tests and everything was still passing.

@nicolerenee nicolerenee added this pull request to the merge queue Sep 28, 2023
Merged via the queue into infratographer:main with commit 0d965b2 Sep 28, 2023
6 checks passed
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