Azure / arm-ttk

Azure Resource Manager Template Toolkit
https://aka.ms/arm-ttk
MIT License
431 stars 186 forks source link

Addressing fixes for GitHub issues 738, 753 and 745 #754

Closed psah434 closed 8 months ago

psah434 commented 8 months ago

Before this fix if an inner template parameter referenced a parent template parameter, if the value of the inner template parameter was not in the form [parameters('parenttemplateparam').....] or [parameters('parenttemplateparam')] then an error would be thrown. This PR fixes the regex where the error will not be thrown to include values like parameter('parenttemplateparam')... or parameter('parenttemplateparam'), or *parameter('parenttemplateparam')] Also if the VALUE of an innertemplateparam is an object, then the correct value was not retrieved previously. This is also fixed.

Addressing issues: https://github.com/Azure/arm-ttk/issues/745 (Removed the condition to have '[' before parameters and a comma can be accepted besides '.' and ']') Test file unit-tests/Parameter-Types-Should-Be-Consistent/Pass/bicepTemplate.json is related

https://github.com/Azure/arm-ttk/issues/753 Test file unit-tests/Parameter-Types-Should-Be-Consistent/Pass/innerParamArrayBicepTemplate.json is a test for this issue The code change where the inner template parameter value.value is retrieved and if the type is not a string then the error is not thrown.

https://github.com/Azure/arm-ttk/issues/738 Test file unit-tests/Parameter-Types-Should-Be-Consistent/Pass/twoModuleBicepTemplate.json is a test for this issue The regex fix to remove the requirement of the regex to always have its value to begin with '[parameters' is lifted.