-
Notifications
You must be signed in to change notification settings - Fork 70
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
Required blocks in resources implemented with terraform-plugin-framework
are listed as optional
#363
Comments
terraform-plugin-framework
are displayed as optionalterraform-plugin-framework
are listed as optional
Hi @kangasta 👋 Thank you for raising this issue. This tool is currently dependent on getting schema information from calling In the meantime the best we could do with the existing information available from Terraform is potentially change how its rendered in the documentation (e.g. without distinguishing between "required" and "optional" for blocks). If you or anyone has particular design ideas around that, it would be great to hear. Another way to avoid this particular documentation limitation is switch from blocks to nested attributes. All attributes in Terraform natively have the concept of "required" versus "optional". For new implementations, using nested attributes instead of blocks is typically recommended. Please note though that for existing schemas, this would be a breaking change as practitioners would have to slightly switch their configuration syntax. |
Maybe instead of just |
Hello! I updated the related PR (#366) so that it renders blocks in separate H3 section only when user defines For example on how this would look in Terraform registry documentation, see for instance upcloud_network resource. |
Terraform CLI and terraform-plugin-docs Versions
Terraform v1.8.2
on darwin_arm64
require github.com/hashicorp/terraform-plugin-docs v0.19.1
Provider Code
Expected Behavior
ip_network
block is listed as required (with min and max items)Actual Behavior
ip_network
block is listed as optionalSteps to Reproduce
tfplugindocs
with provider that has required blocks implemented withterraform-plugin-framework
.How much impact is this issue causing?
Medium
Logs
No response
Additional Information
Based on discussion in discuss.hashicorp.com this is a known issue from while ago, but there was no issue in this repository about the bug.
Code of Conduct
The text was updated successfully, but these errors were encountered: