Skip to content

Commit

Permalink
Skip unnecessary json.Unmarshal in converter (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerTorres authored Aug 9, 2024
1 parent 7f0885c commit 5c3bf22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Optimized performance for types dependent on the JSON converter

## 4.3.1

### Features
Expand Down
7 changes: 2 additions & 5 deletions pkg/converters/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,8 @@ func jsonConverter(in interface{}) (interface{}, error) {
if err != nil {
return nil, err
}
var rawJSON json.RawMessage
err = json.Unmarshal(jBytes, &rawJSON)
if err != nil {
return nil, err
}

rawJSON := json.RawMessage(jBytes)
return &rawJSON, nil
}

Expand Down

0 comments on commit 5c3bf22

Please sign in to comment.