Skip to content

Conversation

XIAOLONGLII
Copy link

@XIAOLONGLII XIAOLONGLII commented Jun 22, 2025

Added test for variable bool and string default value.

Related issue

Fixes #3621

Description

In plain English, describe your approach to addressing the issue linked above. For example, if you made a particular design decision, let us know why you chose this path instead of another solution.

Checklist

  • I have updated the PR title to match CDKTF's style guide
  • I have run the linter on my code locally
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation if applicable
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works if applicable
  • New and existing unit tests pass locally with my changes

Added test for variable bool and string default value.
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

1 similar comment
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@XIAOLONGLII XIAOLONGLII changed the title Update json-to-hcl.test.ts json-to-hcl.test.ts: Added test for variable bool and string default value. Jun 22, 2025
Added sensitive = false
@XIAOLONGLII XIAOLONGLII changed the title json-to-hcl.test.ts: Added test for variable bool and string default value. Added tests for bool and string variable contain default and sensitive false value. Jun 22, 2025
handle falsy primitives (false, 0, "") 
1. at the top-level (early check),
2. and inside the type === "simple" block with the fallback


This ensures values like false don’t silently get dropped.
Added unit tests for: 
false
0
""
null
@XIAOLONGLII XIAOLONGLII changed the title Added tests for bool and string variable contain default and sensitive false value. Fix cdktf synth --hcl fails to render false(bool), 0(int), ""(empty string) Jun 22, 2025
Copy link
Contributor

Hi there! 👋 We haven't heard from you in 60 days and would like to know if you're still working on this or need help. If we don't hear from you before then, I'll auto-close this PR in 30 days.

@github-actions github-actions bot added the stale An issue or pull request that has not been updated in a very long time label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale An issue or pull request that has not been updated in a very long time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cdktf: synth --hcl fails to render false(bool), 0(int), ""(empty string)
1 participant