feat: some stuff?
All checks were successful
Build and Push Server / build-and-push (push) Successful in 4m19s

This commit is contained in:
2026-02-10 18:24:39 +01:00
parent 137e3da6d4
commit f9c4b7bc05
7 changed files with 26 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ func Yaml(input string, block template.Block) (value any, error error) {
return nil, fmt.Errorf("failed to parse yaml '%q': %w", input, err)
}
var out any
var out any // Keep out as any
for _, f := range block.Fields {
if f.Path == "@schema" {
@@ -25,7 +25,14 @@ func Yaml(input string, block template.Block) (value any, error error) {
if f.CodecType == template.CodecConst {
if f.Value != nil {
out = utils.SetPathValue(f.Path, f.Value, out)
// Only set const value if 'out' is a map and the path doesn't exist
if outMap, ok := out.(map[string]any); ok {
if _, exists := renderUtils.GetValueFromPath(outMap, f.Path); !exists {
out = utils.SetPathValue(f.Path, f.Value, out)
}
} else if out == nil { // If out is nil, it's the first value, so set it
out = utils.SetPathValue(f.Path, f.Value, out)
}
}
} else {
if value, ok := res[f.Path]; ok {