INNER CODE UNIT · Go

collectProps

bjw-s-labs/helm-charts · tools/helm-schema-tools/internal/schema/schema.go:28

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) {
		if len(subs) == 0 {
			return
		}
		for k, v := range collectProps(subs[0], depth+1) {
			if _, exists := props[k]; !exists {
				props[k] = v
			}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…