Skip to content

Commit

Permalink
Merge branch 'main' into fix/properly_handle_map_slice_pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Jul 24, 2024
2 parents 63c465c + 2e1112f commit 2fcfe60
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.51.0"
".": "4.52.0"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.52.0](https://github.com/cloudquery/plugin-sdk/compare/v4.51.0...v4.52.0) (2024-07-24)


### Features

* Add JSON type schema ([#1796](https://github.com/cloudquery/plugin-sdk/issues/1796)) ([dbc534b](https://github.com/cloudquery/plugin-sdk/commit/dbc534bc54a3f9f02fd3468bfe256b6c46971614))

## [4.51.0](https://github.com/cloudquery/plugin-sdk/compare/v4.50.1...v4.51.0) (2024-07-22)


Expand Down
2 changes: 1 addition & 1 deletion caser/caser.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *Caser) ToSnake(s string) string {
// append the last word
if s[lastPos:] != "" {
// handle plurals of initialisms like CDNs, ARNs, IDs
if w := s[lastPos:]; w == "s" {
if w := s[lastPos:]; w == "s" && words != nil {
words[len(words)-1] = words[len(words)-1] + w
} else {
words = append(words, s[lastPos:])
Expand Down
5 changes: 5 additions & 0 deletions caser/caser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func Test_ToSnake(t *testing.T) {
{Camel: " H e l l o", Snake: "h_e_l_l_o"},
{Camel: " H e l l o ", Snake: "h_e_l_l_o"},
{Camel: "Hello World", Snake: "hello_world"},
{Camel: "s", Snake: "s"},
{Camel: "S", Snake: "s"},
}
t.Parallel()
c := New()
Expand All @@ -67,6 +69,7 @@ func Test_ToCamel(t *testing.T) {
{Camel: "testCamelCaseLongString", Snake: "test_camel_case_long_string"},
{Camel: "testCamelCaseLongString", Snake: "test_camel_case_long_string"},
{Camel: "testIPv4", Snake: "test_ipv4"},
{Camel: "s", Snake: "s"},
}
t.Parallel()
c := New()
Expand Down Expand Up @@ -94,6 +97,7 @@ func Test_ToTitle(t *testing.T) {
{Title: "Test IPv4", Snake: "test_ipv4"},
{Title: "AWS Test Table", Snake: "aws_test_table"},
{Title: "Gcp Test Table", Snake: "gcp_test_table"}, // no exception specified
{Title: "S", Snake: "s"},
}
t.Parallel()
c := New(WithCustomExceptions(map[string]string{
Expand Down Expand Up @@ -125,6 +129,7 @@ func Test_ToPascal(t *testing.T) {
{Pascal: "TestIPv4", Snake: "test_ipv4"},
{Pascal: "Ec2", Snake: "ec2"},
{Pascal: "S3", Snake: "s3"},
{Pascal: "S", Snake: "s"},
}
t.Parallel()
c := New()
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_plugin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.11

require (
github.com/apache/arrow/go/v17 v17.0.0
github.com/cloudquery/plugin-sdk/v4 v4.51.0
github.com/cloudquery/plugin-sdk/v4 v4.52.0
github.com/rs/zerolog v1.33.0
)

Expand Down
2 changes: 1 addition & 1 deletion transformers/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/thoas/go-funk"
)

const maxJSONTypeSchemaDepth = 5
const maxJSONTypeSchemaDepth = 4

type structTransformer struct {
table *schema.Table
Expand Down
2 changes: 1 addition & 1 deletion transformers/struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,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"}}}}}`,
},
},
}
Expand Down

0 comments on commit 2fcfe60

Please sign in to comment.