-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support single-line objects/arrays #586
Comments
Please... especially when LoC and verbosity are some of the advantages of Bicep By single line assume we mean allowing something like
|
One comment I'd have is that as you start to think about single line objects, consider what would happen if you have a bicep linter and your linter converts from single-line to multi-line. With single line, these would be the same in bicep:
However, a simple code formatting tool may have issues converting between the two since there's not just a white space change. Give that changing lines involved more than just white-space, my suggestion is that you either support just a white-space separator or support both white-space and comma. This would mean that this would be valid syntax:
Along with
Personally, I support the second syntax (commas) because then each object is a (semi) valid JSON primitive. It would be super nice if it was a valid primitive, but that would require supporting real quote characters :-) |
Seems the same applies for the contains() function. Instead of writing var supportsBlobService = storageAccountKind == 'BlockBlobStorage' || storageAccountKind == 'BlobStorage' || storageAccountKind == 'StorageV2' || storageAccountKind == 'Storage' I would rather be able to write: var supportsBlobService = contains(['BlockBlobStorage', 'BlobStorage', 'StorageV2', 'Storage'], storageAccountKind) |
I get around the param subnetName string
var specialSubnet = [
'GatewaySubnet'
'AzureBastionSubnet'
'AzureFirewallSubnet'
]
var isSpecial = contains(specialSubnet, subnetName )
|
@anthony-c-martin - we can probably remove this from the limitation list in Readme.md :) |
Remember to update documentation: https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/data-types#arrays |
@HenrikSommer-eng, thanks for reminding me - I have raised MicrosoftDocs/azure-docs#95371 for our docs team to pick up. |
This could be implemented by #498, but the other option is to somehow do this without
,
The text was updated successfully, but these errors were encountered: