Bicep error/warning code - BCP078
This error/warning occurs when you reference a custom-tagged union data type, but the required value isn't provided.
Error/warning description
The property <property-name> requires a value of type <type-name>, but none was supplied.
Examples
The following example raises the error because the property type with the value of foo
or _bar_
isn't provided.
@discriminator('type')
type taggedUnion = {type: 'foo', value: int} | {type: 'bar', value: bool}
output outValue taggedUnion = {}
You can fix the error by including the properties:
@discriminator('type')
type taggedUnion = {type: 'foo', value: int} | {type: 'bar', value: bool}
output outValue taggedUnion = {type: 'foo', value: 3}
If the property value isn't provided in the preceding example, you get BCP035.
Next steps
For more information about Bicep error and warning codes, see Bicep warnings and errors.