Bicep version
Bicep CLI version 0.44.1 (28275db)
Describe the bug
When using the new extendable .bicepparam feature together with a parameter that is typed using a user-defined type (UDT), the diagnostics shown for invalid inherited parameter values is a bit misleading.
In my example, the main Bicep file defines a parameter parPerson of type personType. The base parameter file deliberately assigns an object to parPerson that does not match the UDT contract.
Instead of showing a clear error on the incorrect property in the base parameter file, the main parameter file reports that the param keyword is missing:
Additionally, the main.bicepparam file uses using './main.bicep' and extends './base.bicepparam', the diagnostic shown on the inherited base value appears as a warning instead of an error:
To Reproduce
Create the following files:
main.bicep:
param parName string
param parAge int
param parAddress string
param parPerson personType
type personType = {
name: string
age: int
address: string
}
output name string = parName
output age int = parAge
output address string = parAddress
output person personType = parPerson
main.bicepparam:
using './main.bicep'
extends './base.bicepparam'
param parAddress = 'a'
param parAge = 26
param parName = 'c'
base.bicepparam:
using none
param parPerson = {
test: 'testing'
}
Additional context
This behaviour is confusing for the user because it's harder to understand where the issue is. In this small example its easy to spot the problem, but in larger templates it's harder. Especially when there is no UDT autocompletion available in the base.bicepparam (extended bicepparam). Additionally, there's no validation on the bicepparam file that is being extended.
Bicep version
Bicep CLI version 0.44.1 (28275db)
Describe the bug
When using the new extendable
.bicepparamfeature together with a parameter that is typed using a user-defined type (UDT), the diagnostics shown for invalid inherited parameter values is a bit misleading.In my example, the main Bicep file defines a parameter
parPersonof typepersonType. The base parameter file deliberately assigns an object toparPersonthat does not match the UDT contract.Instead of showing a clear error on the incorrect property in the base parameter file, the main parameter file reports that the
paramkeyword is missing:Additionally, the
main.bicepparamfile usesusing './main.bicep'andextends './base.bicepparam', the diagnostic shown on the inherited base value appears as a warning instead of an error:To Reproduce
Create the following files:
main.bicep:
main.bicepparam:
base.bicepparam:
Additional context
This behaviour is confusing for the user because it's harder to understand where the issue is. In this small example its easy to spot the problem, but in larger templates it's harder. Especially when there is no UDT autocompletion available in the
base.bicepparam(extended bicepparam). Additionally, there's no validation on the bicepparam file that is being extended.