Open asilverman opened 1 month ago
Actually, I figured out the issue is that for param
I need to use @sys.description
but it wasn't very straightforward to understand.
Maybe the message can be made more informative for these previously working decorators
The error is being caused by this line in the template:
param description string = 'Default Description'
which adds a parameter that shadows the @description()
decorator. It might be helpful to add a message like Did you mean 'sys.description'?
to the BCP059 message (similar to how we suggest likely matches when an unrecognized property is referenced).
Yeah I think it would be helpful to add a hint like that would help, especially since the file was generated by the decompiler. Maybe adding a conditional in the decompiler to disambiguate 'description' to 'sys.description' may be useful to avoid confusion
Bicep version run
bicep --version
via the Bicep CLI,az bicep version
via the AZ CLI or via VS code by navigating to the extensions tab and searching for BicepDescribe the bug The Bicep linter is complaining about the description decorator, the documentation says the below is valid syntax
To Reproduce
Create a new file with the following contents:
Additional context The documentation for this error is not very informative, a more clear description would help: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-core-diagnostics#BCP059
If you instead paste the following contents, the problem goes away:
Content is generated from 'Paste JSON as Bicep' VSCode command on the following content: