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

[WIP] command/jsonprovider: export providers schemas to json #20446

Merged
merged 5 commits into from
Feb 25, 2019

Conversation

mildwonkey
Copy link
Contributor

@mildwonkey mildwonkey commented Feb 23, 2019

TODO:

  • e2e tests
  • documentation
  • embetter comments!

@mildwonkey
Copy link
Contributor Author

I'm going to work on the bulk of the documentation in a separate PR.

@mildwonkey mildwonkey requested a review from a team February 25, 2019 19:35
@mildwonkey mildwonkey marked this pull request as ready for review February 25, 2019 19:35
Copy link
Contributor

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor feedback inline, but nothing seems blocking if you'd prefer to merge as-is and think about the feedback in possible future PRs.

command/jsonprovider/block.go Outdated Show resolved Hide resolved
case "NestingMap":
ret.NestingMode = "map"
default:
// unpossible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move the statement from "nestingModeInvalid" down here and remove that case? I think it being literally nestingModeInvalid and it being some value that isn't in the enum at all are... both invalid, really.

MaxItems: uint64(nestedBlock.MaxItems),
}

switch nestedBlock.Nesting.String() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was surprised to see the .String() call here vs. switching directly on the nestedBlock.Nesting value. Could you add a comment explaining it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just drop the .String() and check the nested mode directly - I had doubts when I wrote that but forgot to follow up.

At this point, json output is the only option for the `terraform
providers schema` command. To maintain consistency with other terraform
commands, and with future enhancements in mind, this should be a
requireed flag.
@mildwonkey mildwonkey requested review from apparentlymart and a team February 25, 2019 20:47
@mildwonkey mildwonkey merged commit 16823f4 into master Feb 25, 2019
@mildwonkey mildwonkey deleted the mildwonkey/f-providers-schema branch February 25, 2019 21:32
@ghost
Copy link

ghost commented Mar 29, 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 Mar 29, 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