INNER CODE UNIT · Go
CollectAllProperties
bjw-s-labs/helm-charts · tools/helm-schema-tools/internal/schema/schema.go:21
func CollectAllProperties(schema *jsonschema.Schema) map[string]*jsonschema.Schema {
return collectProps(schema, 0)
}
// collectProps is the recursion-guarded implementation of CollectAllProperties.
// depth is the current nesting level; returning nil when it reaches
// maxCollectDepth prevents stack overflow from cyclic schemas.
func collectProps(schema *jsonschema.Schema, depth int) map[string]*jsonschema.Schema {
if depth >= maxCollectDepth {
return nil
}
props := make(map[string]*jsonschema.Schema)
if schema.Properties != nil {
maps.Copy(props, *schema.Properties)
}
mergeFirstBranch := func(subs []*jsonschema.Schema) {