databricks-cli/libs/dyn/convert
Pieter Noordhuis 18166f5b47
Add option to include fields present in the type but not in the value (#1211)
## Changes

This feature supports variable lookups in a `dyn.Value` that are present
in the type but haven't been initialized with a value.

For example: `${bundle.git.origin_url}` is present in the `dyn.Value`
only if it was assigned a value. If it wasn't assigned a value it should
resolve to the empty string. This normalization option, when set,
ensures that all fields that are represented in the specified type are
present in the return value.

This change is in support of #1098.

## Tests

Added unit test.
2024-02-15 15:16:40 +00:00
..
end_to_end_test.go Fix dynamic representation of zero values in maps and slices (#1154) 2024-01-31 14:25:13 +00:00
error.go Rename libs/config -> libs/dyn (#1086) 2023-12-22 13:20:45 +00:00
from_typed.go Retain partially valid structs in `convert.Normalize` (#1203) 2024-02-13 14:12:19 +00:00
from_typed_test.go Empty struct should yield empty map in `convert.FromTyped` (#1177) 2024-02-07 09:25:07 +00:00
normalize.go Add option to include fields present in the type but not in the value (#1211) 2024-02-15 15:16:40 +00:00
normalize_test.go Add option to include fields present in the type but not in the value (#1211) 2024-02-15 15:16:40 +00:00
struct_info.go Rename libs/config -> libs/dyn (#1086) 2023-12-22 13:20:45 +00:00
struct_info_test.go Rename libs/config -> libs/dyn (#1086) 2023-12-22 13:20:45 +00:00
to_typed.go Zero destination struct in `convert.ToTyped` (#1178) 2024-02-07 09:25:53 +00:00
to_typed_test.go Zero destination struct in `convert.ToTyped` (#1178) 2024-02-07 09:25:53 +00:00