Skip to content

Commit

Permalink
fix(go-sdk): dont escape HTML characters in conditions (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh authored Jan 26, 2024
2 parents 52c1f76 + d37c09a commit 00bd2b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config/clients/go/template/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package {{packageName}}

{{#models}}
import (
{{#model}}
{{^isEnum}}
"bytes"
{{/isEnum}}
{{/model}}

"encoding/json"
{{#imports}}
"{{import}}"
Expand Down
9 changes: 8 additions & 1 deletion config/clients/go/template/model_simple.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,14 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) {
}
{{/isAdditionalPropertiesTrue}}
return json.Marshal(toSerialize)
var b bytes.Buffer
enc := json.NewEncoder(&b)
enc.SetEscapeHTML(false)
err := enc.Encode(toSerialize)
if err != nil {
return nil, err
}
return b.Bytes(), nil
}
{{#isAdditionalPropertiesTrue}}
Expand Down

0 comments on commit 00bd2b2

Please sign in to comment.