Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json-output: Fix unknowns for tuples and sets #31236

Merged
merged 1 commit into from Jun 17, 2022

Commits on Jun 13, 2022

  1. 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.
    alisdair committed Jun 13, 2022
    Copy the full SHA
    9497b2c View commit details
    Browse the repository at this point in the history