Skip to content

Commit dfa7a32

Browse files
feat: Fixed error when parameter has boolean as value
1 parent b6fdbce commit dfa7a32

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Bicep.Docs.Tests/BasicTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ public void Basic_WhenJsonFileIsProvided_DocumentationShouldBeGenerated()
1313
{
1414
Program.Main(["--template", "templates/json/basic.json"]);
1515
}
16+
17+
[Test]
18+
public void Basic_WhenBicepFileIsProvidedWithBooleanValueForParameter_DocumentationShouldBeGenerated()
19+
{
20+
Program.Main(["--template", "templates/keyvault/main.bicep"]);
21+
}
1622
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@description('Create a Key Vault with the specified location')
2+
@allowed([ 'eastus', 'westus', 'centralus' ])
3+
param parLocation string = 'eastus'
4+
5+
@description('Enable the Key Vault for deployment')
6+
param parEnabledForDeployment bool = true
7+
8+
resource kv 'Microsoft.KeyVault/vaults@2023-07-01' = {
9+
name: 'kv'
10+
location: parLocation
11+
properties: {
12+
sku: {
13+
family: 'A'
14+
name: 'standard'
15+
}
16+
tenantId: tenant().tenantId
17+
enabledForDeployment: parEnabledForDeployment
18+
}
19+
}

Bicep.Docs/TemplateSchema.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal class TemplateParameter
2323
public string Type { get; set; } = null!;
2424

2525
[JsonPropertyName("defaultValue")]
26-
public string? DefaultValue { get; set; }
26+
public object? DefaultValue { get; set; }
2727

2828
[JsonPropertyName("allowedValues")]
2929
public string[]? AllowedValues { get; set; }

0 commit comments

Comments
 (0)