# BCPNFR17 - Code Styling - Type casting Module Specification for the Azure Verified Modules (AVM) program ID: BCPNFR17 - Category: Composition - Code Styling - Type casting To improve the usability of primitive module properties declared as strings, you SHOULD declare them using a type which better represents them, and apply any required casting in the module on behalf of the user. For reference, please refer to the following examples: Boolean as String Boolean as String Before After @allowed([ 'false' 'true' ]) param myParameterValue string = 'false' resource myResource '(...)' = { (...) properties: { myParameter: myParameterValue } } param myParameterValue string = false resource myResource '(...)' = { (...) properties: { myParameter: string(myParameterValue) } } Integer Array as String Array Integer Array as String Array Before After @allowed([ '1' '2' '3' ]) param zones array resource myResource '(...)' = { (...) properties: { zones: zones } } @allowed([ 1 2 3 ]) param zones int[] resource myResource '(...)' = { (...) properties: { zones: map(zones, zone => string(zone)) } } --- Source: https://raw.githubusercontent.com/Azure/Azure-Verified-Modules/refs/heads/main/docs/content/specs-defs/includes/bicep/shared/non-functional/BCPNFR17.md Last Modified: 0001-01-01