terraform-plugin-docs icon indicating copy to clipboard operation
terraform-plugin-docs copied to clipboard

Stronger emphasis on `Deprecated` schema fields

Open nmuesch opened this issue 3 years ago • 2 comments

Currently, when a field in a schema is deprecated, it shows up in parenthesis next to whether it's required or not.

Live example here under thresholds - https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor#optional

thresholds (Map of String, Deprecated) Alert thresholds of the monitor.

Could the fact that a field is deprecated be more strongly represented? A few ideas for this may be -

  • Make the word Deprecated bold to stand out more
  • Maybe have a new section Required, Optional, Deprecated

Thanks for this project 🙂

nmuesch avatar Feb 01 '21 22:02 nmuesch

Could you also include the deprecation message associated with the field in the description?

andreaangiolillo avatar Jan 16 '24 17:01 andreaangiolillo

Drive-by note about potentially including the deprecation message that can be included in attribute definitions. Currently this information is not possible to inject into the documentation generation because this tool is dependent on information output via the Terraform Plugin Protocol and the terraform providers schema -json command. They only expose deprecation as a boolean true/false today. There have been some considerations about exposing the existing deprecation message string as a "quick win" across the protocol (and also help fix empty messaging shown in editors, such as https://github.com/hashicorp/terraform-ls/issues/1538), however it may make more sense to encode and send more structured information from providers to help editors and other tools actually remediate these deprecations and many other configuration refactoring situations (code actions in editor terminology). Since that discovery and implementation effort might take a bit of time based on prioritization, I think we can be pragmatic to include the existing data though since there are situations where a deprecation might not be directly usable as this sort of code action.

bflad avatar Jan 18 '24 17:01 bflad