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

fix panic when validating composite schema type #773

Merged
merged 3 commits into from
Jan 14, 2015
Merged

fix panic when validating composite schema type #773

merged 3 commits into from
Jan 14, 2015

Conversation

ceh
Copy link
Contributor

@ceh ceh commented Jan 12, 2015

Fixes issue #691.

@ceh
Copy link
Contributor Author

ceh commented Jan 12, 2015

Not sure if the reasoning, see commit message of 4893eb8, for renaming list to array in the docs is sound.

Lists might be what the community actually prefers?

Don't check if the root key is being computed for composite types.
Instead, continue recursing the composite type in order to check if
the sub-key, key.N, for each individual element is being computed.

Fixes a panic which occurs when validating a composite type where
the value is an unknown kind for the schema.
Add an acceptance test where terraform plan should error due
to validation errors.
The Terraform configuration syntax defines what arrays are.
Use the word array consistently throughout the documentation
instead of list.

The corresponding JSON datatype is called array as well, and
since the Terraform configuration syntax is interoperable with
JSON it makes sense to use the term array to describe them.
@ceh ceh changed the title Validate schema type values for sets, lists and maps fix panic when validating composite schema type Jan 13, 2015
@mitchellh
Copy link
Contributor

Yeah I think discussing "list" vs "array" is getting a little bikeshed-y. Some programming languages use lists, some use arrays, I imagine devs/ops are generally comfortable with both. I prefer "list" personally for no better reason than when I hear "array" I put on my C hat and think of a fixed size memory buffer and its so mechanical to me that I feel that "list" is more human friendly.

Like I said, not a good reason, but also not one I think matters.

@mitchellh
Copy link
Contributor

LGTM. I think I'm going to just keep things as "list" since we also use that internally everywhere. But thanks for this fix and thanks for the tests, great job. :)

mitchellh added a commit that referenced this pull request Jan 14, 2015
helper/schema: fix panic when validating composite schema type
@mitchellh mitchellh merged commit 152e72f into hashicorp:master Jan 14, 2015
@ceh ceh deleted the issue-691 branch January 14, 2015 17:47
@ceh
Copy link
Contributor Author

ceh commented Jan 14, 2015

@mitchellh Just noticed 5e8b300. Do you prefer that contributors also updates the CHANGELOG with a reference to the fixed issue in the proposed PR?

@mitchellh
Copy link
Contributor

@ceh I like to update the CL myself, the reason being that its a common place for merge conflict in a PR and its the dumbest merge conflict...

@ghost
Copy link

ghost commented May 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants