@@ -11,7 +11,6 @@ import (
1111 "sort"
1212 "text/template"
1313
14- "github.com/apache/arrow/go/v13/arrow"
1514 "github.com/cloudquery/plugin-sdk/v3/caser"
1615 "github.com/cloudquery/plugin-sdk/v3/schema"
1716)
@@ -128,12 +127,16 @@ type jsonColumn struct {
128127
129128func (p * Plugin ) renderTablesAsJSON (dir string , tables schema.Tables ) error {
130129 jsonTables := p .jsonifyTables (tables )
131- b , err := json .MarshalIndent (jsonTables , "" , " " )
130+ buffer := & bytes.Buffer {}
131+ m := json .NewEncoder (buffer )
132+ m .SetIndent ("" , " " )
133+ m .SetEscapeHTML (false )
134+ err := m .Encode (jsonTables )
132135 if err != nil {
133- return fmt . Errorf ( "failed to marshal tables as json: %v" , err )
136+ return err
134137 }
135138 outputPath := filepath .Join (dir , "__tables.json" )
136- return os .WriteFile (outputPath , b , 0644 )
139+ return os .WriteFile (outputPath , buffer . Bytes () , 0644 )
137140}
138141
139142func (p * Plugin ) jsonifyTables (tables schema.Tables ) []jsonTable {
@@ -200,8 +203,7 @@ func (p *Plugin) renderAllTables(t *schema.Table, dir string) error {
200203
201204func (p * Plugin ) renderTable (table * schema.Table , dir string ) error {
202205 t := template .New ("" ).Funcs (map [string ]any {
203- "formatType" : formatType ,
204- "title" : p .titleTransformer ,
206+ "title" : p .titleTransformer ,
205207 })
206208 t , err := t .New ("table.md.go.tpl" ).ParseFS (templatesFS , "templates/table.md.go.tpl" )
207209 if err != nil {
@@ -228,10 +230,6 @@ func formatMarkdown(s string) string {
228230 return reMatchHeaders .ReplaceAllString (s , `$1` + "\n \n " )
229231}
230232
231- func formatType (v arrow.DataType ) string {
232- return v .String ()
233- }
234-
235233func indentToDepth (table * schema.Table ) string {
236234 s := ""
237235 t := table
0 commit comments