opentofu/internal/command/jsonplan
Alisdair McDiarmid 9497b2cd6f json-output: Fix unknowns for tuples and sets
The JSON output for sequences previously omitted unknown values for
tuples and sets, which made it impossible to interpret the corresponding
unknown marks. For example, consider this resource:

    resource "example_resource" "example" {
      tags = toset(["alpha", timestamp(), "charlie"])
    }

This would previously be encoded in JSON as:

    "after": {
        "tags": ["alpha", "charlie"]
    },
    "after_unknown": {
        "id": true,
        "tags": [false, true, false]
    },

That is, the timestamp value would be omitted from the output
altogether, while the corresponding unknown marks would include a value
for each of the set members.

This commit changes the behaviour to:

    "after": {
        "tags": ["alpha", null, "charlie"]
    },
    "after_unknown": {
        "id": true,
        "tags": [false, true, false]
    },

This aligns tuples and sets with the prior behaviour for lists, and
makes it clear which elements are known and which are unknown.
2022-06-13 14:33:40 -04:00
..
condition.go core: Store condition block results in plan 2022-04-04 15:36:29 -04:00
doc.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
module.go Move command/ to internal/command/ 2021-05-17 14:09:07 -07:00
plan.go json-output: Fix unknowns for tuples and sets 2022-06-13 14:33:40 -04:00
plan_test.go json-output: Fix unknowns for tuples and sets 2022-06-13 14:33:40 -04:00
resource.go json-output: Previous address for resource changes 2021-09-20 15:25:23 -04:00
values.go json-output: Add output type to JSON format 2022-04-27 13:30:15 -04:00
values_test.go json-output: Add output type to JSON format 2022-04-27 13:30:15 -04:00