Improve documentation of object
type for provider-defined functions
#333
Labels
enhancement
New feature or request
object
type for provider-defined functions
#333
Terraform CLI and terraform-plugin-docs Versions
github.com/hashicorp/terraform-plugin-docs v0.18.0
Use Cases or Problem Statement
Currently, when documenting a provider-defined function that has an object as a parameter or return type, there is no mechanism that documents the attributes of said object.
Provider Schema
Documentation Output
The output currently just prints
object
with no indication of what attributes are available.Workaround
Currently, you'll need to document the object manually with a template, but that's only really an "escape hatch" solution and not ideal for the broader ecosystem. Example template for
rfc3339_parse
:Proposal
Once available downstream introduce logic to generate a section for
object
type attributes, similar to nested attributes in resources/data source documentation.Downstream Dependency
Currently,
terraform-plugin-docs
relies on theterraform providers schema -json
command, which relies on theGetProviderSchema
RPC. These RPCs typically only contain information that is relevant to Terraform operations and sometimes don't contain enough information for downstream tools like this doc generator or the Terraform language server. In this case, the RPC does not contain adescription
field for each attribute in an object.Similar issues that are blocked by this dependency on the
GetProviderSchema
RPC:How much impact is this issue causing?
Low
Additional Information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: