From b695d8a1da9e472956f67d78cfdbbd845b7ab457 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Wed, 24 Jul 2024 14:22:24 +0100 Subject: [PATCH 1/2] fix: Reduce JSON column schema nesting --- transformers/struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transformers/struct.go b/transformers/struct.go index e47b2610d2..e56723e89e 100644 --- a/transformers/struct.go +++ b/transformers/struct.go @@ -14,7 +14,7 @@ import ( "github.com/thoas/go-funk" ) -const maxJSONTypeSchemaDepth = 5 +const maxJSONTypeSchemaDepth = 4 type structTransformer struct { table *schema.Table From c67c2611ee79c323d393217b016fa9ee13b3bd99 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Wed, 24 Jul 2024 14:27:40 +0100 Subject: [PATCH 2/2] test: Fix test --- transformers/struct_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transformers/struct_test.go b/transformers/struct_test.go index 63342b9f31..f2a926776a 100644 --- a/transformers/struct_test.go +++ b/transformers/struct_test.go @@ -601,7 +601,7 @@ func TestJSONTypeSchema(t *testing.T) { } `json:"level0"` }{}, want: map[string]string{ - "level0": `{"level1":{"level2":{"level3":{"level4":{"level5":{"level6":"json"}}}}}}`, + "level0": `{"level1":{"level2":{"level3":{"level4":{"level5":"json"}}}}}`, }, }, }