-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes schema.json and helm docs bugs (#429)
* add debug logging to custom type gneerator * handle 4.3.2 boolean json schema * fix omitChildren nil pointer child bug * stop json schema from leaking between chart gens in same process * code cleanup * add changelog * fix codegen issue * support merging json schemas together * unfocus test
- Loading branch information
Albert
authored
Mar 2, 2023
1 parent
70ead40
commit 7fa57b0
Showing
8 changed files
with
202 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
changelog: | ||
- type: FIX | ||
description: Fixes some bugs generating schema.json and helm docs | ||
issueLink: https://github.com/solo-io/skv2/issues/428 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package doc_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestDoc(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Doc Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package doc_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
"github.com/solo-io/skv2/codegen/doc" | ||
) | ||
|
||
var _ = Describe("GenerateHelmValuesDoc", func() { | ||
It("handles case where map value struct has a nil pointer field that omits children", func() { | ||
type ChildType2 struct { | ||
} | ||
type ChildType struct { | ||
Field1 *ChildType2 `json:"field1" desc:"my field" omitChildren:"true"` | ||
} | ||
|
||
type TestType struct { | ||
Sidecars map[string]ChildType `json:"sidecars"` | ||
} | ||
|
||
result := doc.GenerateHelmValuesDoc( | ||
TestType{}, | ||
"test", | ||
"my test", | ||
) | ||
expected := doc.HelmValues{ | ||
{ | ||
Key: "test", | ||
Type: "struct", | ||
DefaultValue: " ", | ||
Description: "my test", | ||
}, | ||
{ | ||
Key: "test.sidecars", | ||
Type: "map[string, struct]", | ||
DefaultValue: "null", | ||
Description: "", | ||
}, | ||
{ | ||
Key: "test.sidecars.<MAP_KEY>", | ||
Type: "struct", | ||
DefaultValue: " ", | ||
Description: "", | ||
}, | ||
{ | ||
Key: "test.sidecars.<MAP_KEY>.Field1", | ||
Type: "struct", | ||
DefaultValue: " ", | ||
Description: "my field", | ||
}, | ||
} | ||
Expect(result).To(Equal(expected)) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters