Skip to content
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

generate: Prevent incorrect attribute association with very deep nesting #382

Merged
merged 1 commit into from
Jun 3, 2024

Commits on Jun 3, 2024

  1. generate: Prevent incorrect attribute association with very deep nesting

    Reference: #380
    
    After introducing the new unit test matching the given schema and expected output, prior to the logic change:
    
    ```
    --- FAIL: TestRender (0.00s)
        --- FAIL: TestRender/deep_nested_attributes (0.00s)
            /Users/bflad/src/github.com/hashicorp/terraform-plugin-docs/internal/schemamd/render_test.go:91: Unexpected diff (-wanted, +got):   strings.Join({
                  	... // 1062 identical bytes
                  	"el_two.level_three.level_four_primary. (see [below for nested sc",
                  	"hema](#nestedatt--level_one--level_two--level_three--level_four_",
                - 	"prim",
                + 	"second",
                  	"ary--level_five))\n- `level_four_primary_string` (String) Parent ",
                  	"should be level_one.level_two.level_three.level_four_primary.\n\n<",
                  	`a id="nestedatt--level_one--level_two--level_three--level_four_`,
                - 	"prim",
                + 	"second",
                  	"ary--level_five\"></a>\n### Nested Schema for `level_one.level_two",
                  	".level_three.level_four_",
                - 	"prim",
                + 	"second",
                  	"ary.level_five`\n\nOptional:\n\n- `level_five_string` (String) Paren",
                  	"t should be level_one.level_two.level_three.level_four_primary.l",
                  	"evel_five.",
                  }, "")
    ```
    bflad committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    817cf43 View commit details
    Browse the repository at this point in the history