@@ -29,7 +29,8 @@ func (b *JSONBuilder) Append(v any) {
29
29
return
30
30
}
31
31
32
- data , err := json .MarshalNoEscape (v ) // per https://github.com/cloudquery/plugin-sdk/issues/622
32
+ // per https://github.com/cloudquery/plugin-sdk/issues/622
33
+ data , err := json .MarshalWithOption (v , json .DisableHTMLEscape ())
33
34
if err != nil {
34
35
panic (err )
35
36
}
@@ -38,7 +39,8 @@ func (b *JSONBuilder) Append(v any) {
38
39
}
39
40
40
41
func (b * JSONBuilder ) UnsafeAppend (v any ) {
41
- data , err := json .MarshalNoEscape (v ) // per https://github.com/cloudquery/plugin-sdk/issues/622
42
+ // per https://github.com/cloudquery/plugin-sdk/issues/622
43
+ data , err := json .MarshalWithOption (v , json .DisableHTMLEscape ())
42
44
if err != nil {
43
45
panic (err )
44
46
}
@@ -61,7 +63,8 @@ func (b *JSONBuilder) AppendValues(v []any, valid []bool) {
61
63
if ! valid [i ] {
62
64
continue
63
65
}
64
- data [i ], err = json .Marshal (v [i ])
66
+ // per https://github.com/cloudquery/plugin-sdk/issues/622
67
+ data [i ], err = json .MarshalWithOption (v [i ], json .DisableHTMLEscape ())
65
68
if err != nil {
66
69
panic (err )
67
70
}
@@ -135,9 +138,9 @@ func (a *JSONArray) Value(i int) any {
135
138
return nil
136
139
}
137
140
138
- arr := a .Storage ().(* array.Binary )
139
141
var data any
140
- err := json .UnmarshalNoEscape (arr .Value (i ), & data )
142
+ // per https://github.com/cloudquery/plugin-sdk/issues/622
143
+ err := json .UnmarshalNoEscape (a .Storage ().(* array.Binary ).Value (i ), & data )
141
144
if err != nil {
142
145
panic (fmt .Errorf ("invalid json: %w" , err ))
143
146
}
@@ -160,13 +163,14 @@ func (a *JSONArray) MarshalJSON() ([]byte, error) {
160
163
if a .IsNull (i ) {
161
164
continue
162
165
}
163
-
166
+ // per https://github.com/cloudquery/plugin-sdk/issues/622
164
167
err := json .UnmarshalNoEscape (arr .Value (i ), & values [i ])
165
168
if err != nil {
166
169
panic (fmt .Errorf ("invalid json: %w" , err ))
167
170
}
168
171
}
169
- return json .Marshal (values )
172
+ // per https://github.com/cloudquery/plugin-sdk/issues/622
173
+ return json .MarshalWithOption (values , json .DisableHTMLEscape ())
170
174
}
171
175
172
176
func (a * JSONArray ) GetOneForMarshal (i int ) any {
0 commit comments