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

feat: add default values to attributes to documentation

Open mavogel opened this issue 4 years ago • 4 comments

Current behavior

Given the schema entry:

"rm": {
	Type:        schema.TypeBool,
	Description: "If true, then the container will be automatically removed after his execution.",
	Default:     false,
	Optional:    true,
},

the rendered output is

- **rm** (Boolean) If true, then the container will be automatically removed after his execution.

Desired behavior

I'd like to have Defaults to abc in the generation as well as follows:

- **rm** (Boolean) If true, then the container will be automatically removed after his execution. Defaults to `false`

Versions

  • terraform-plugin-docs: v0.4.0
  • terraform-plugin-sdk/v2 v2.6.1

mavogel avatar May 17 '21 12:05 mavogel

While not official, you can achieve this with a workaround in your own provider. Check out https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/internal/provider/provider.go#L23-L48 for an example.

jacobbednarz avatar Jun 11 '22 03:06 jacobbednarz