Skip to content

Commit ea19139

Browse files
Update infra/scripts/validate_bicep_params.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 86c3682 commit ea19139

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

infra/scripts/validate_bicep_params.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ def parse_parameters_json(json_path: Path) -> list[str]:
7979
"""Return the raw parameter key names (preserving whitespace) from a
8080
parameters JSON file."""
8181
text = json_path.read_text(encoding="utf-8-sig")
82-
# azd parameter files may use ${VAR=default} syntax which is not valid JSON.
83-
# Replace boolean-like defaults so json.loads doesn't choke.
82+
# azd parameter files may include ${VAR} or ${VAR=default} placeholders inside
83+
# string values. These are valid JSON strings, but we sanitize them so that
84+
# json.loads remains resilient to azd-specific placeholders and any unusual
85+
# default formats.
8486
sanitized = re.sub(r'"\$\{[^}]+\}"', '"__placeholder__"', text)
8587
try:
8688
data = json.loads(sanitized)

0 commit comments

Comments
 (0)