Skip to content

Feature: Generate nested inputs for variables with object({}) #242

@nickw8

Description

@nickw8

Prerequisites

Put an x into the box that applies:

  • This issue describes a bug.
  • This issue describes a feature request.

For more information, see the Contributing Guidelines.

Description

It would be amazing to generate a nested inputs section when an object type is detected. Currently in input it just shows the whole object with all its inputs, ideally a new section at h3 level would be created called 'Nested Inputs' that has the name and type specified with maybe a h4 heading giving the name of the input calling the object. Honestly, the way you do it works and that this project exists is amazing. Just think this would make things easier to read and it follows with the way Terraform documentation displays things on their own website.

Actual Behavior

Inputs

Name Description Type Default Required
create_repos Toggle creation of repos bool false no
ecr_config Configurations needed to implement the aws-ecr module
object({
enabled = bool,
repos = map(object({
max_image_count = number,
scan_images_on_push = bool,
tags = map(string)
}))
})
n/a yes

Here you can see the jumbled mess that objects create.

Do you have long logs to share? Please go to https://ghostbin.com and insert the link here.

Expected Behavior

Inputs

Name Description Type Default Required
create_repos Toggle creation of repos bool false no
ecr_config Configurations needed to implement the aws-ecr module object({}) n/a yes

Nested inputs

ecr_config

Name Type Default Required
enabled bool n/a yes
repos map(object({})) n/a yes

repos

Name Type Default Required
max_image_count number n/a yes
scan_images_on_push bool n/a yes
tags map(string) n/a yes

This makes it a lot clearer on object inputs.

Version

You can get this information via terraform-docs --version.
terraform-docs version v0.0.0- v0.9.1 darwin/amd64 BuildDate: 2020-04-03T02:30:49+0100

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions