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

Added write-only support to generate #434

Merged
merged 13 commits into from
Feb 13, 2025
Merged

Added write-only support to generate #434

merged 13 commits into from
Feb 13, 2025

Conversation

rainkwan
Copy link
Contributor

@rainkwan rainkwan commented Jan 16, 2025

For the generate command, updated the render logic using terraform-json to add WriteOnly.

For an example JSON Attribute:

## Schema

### Optional

            "write_only_string_attribute": {
                "type": "string",
                "description": "example write only string attribute",
                "description_kind": "markdown",
                "optional": true,
                "write_only": true
            }

We get the following md:

## Schema

### Optional

- `write_only_string_attribute` (String, Write-only) example write only string attribute

Copy link

hashicorp-cla-app bot commented Jan 16, 2025

CLA assistant check
All committers have signed the CLA.

@rainkwan rainkwan marked this pull request as ready for review January 16, 2025 19:12
@rainkwan rainkwan requested a review from a team as a code owner January 16, 2025 19:12
@rainkwan rainkwan changed the title rk/writeonlysupport Added write-only support rk/writeonlysupport Jan 16, 2025
@rainkwan rainkwan changed the title Added write-only support rk/writeonlysupport Added write-only support to generate Jan 16, 2025
@SBGoods SBGoods marked this pull request as draft January 16, 2025 19:43
@rainkwan rainkwan marked this pull request as ready for review January 17, 2025 21:36
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the changes here look good! Two general comments to consider:

  • We'll want to add a callout somewhere on the markdown page, like -> Write-only attributes are supported in Terraform 1.11 and later. (we already started a thread offline about it)
  • We'll want a changelog for this new functionality!

internal/schemamd/render.go Outdated Show resolved Hide resolved
internal/schemamd/render_test.go Show resolved Hide resolved
@rainkwan
Copy link
Contributor Author

All the changes here look good! Two general comments to consider:

  • We'll want to add a callout somewhere on the markdown page, like -> Write-only attributes are supported in Terraform 1.11 and later. (we already started a thread offline about it)
  • We'll want a changelog for this new functionality!

Added the changelog but decided maybe we should just merge this PR and later add the link to write-only docs when it is available and the render logic for printing out that it is only supported in Terraform 1.11 in a different PR.

@rainkwan rainkwan requested a review from austinvalle February 12, 2025 23:16
@austinvalle austinvalle added this to the v0.21.0 milestone Feb 13, 2025
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but decided maybe we should just merge this PR and later add the link to write-only docs when it is available and the render logic for printing out that it is only supported in Terraform 1.11 in a different PR.

Yeah if you want to open a separate PR for that before we release v0.21.0 of plugin-docs, sounds good to me! 🚀

@rainkwan rainkwan merged commit 411d870 into main Feb 13, 2025
6 checks passed
@rainkwan rainkwan deleted the rk/writeonlysupport branch February 13, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants