-
Notifications
You must be signed in to change notification settings - Fork 774
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
Ability to specify the shape of object parameters and variables #898
Comments
It's a good idea, but there is a lot of design work to consider for a feature like this as it can get complex very quickly. We'd love to do it and think it'd be a powerful feature, but not something we will get to quickly. This is somewhat related, but different from #114 |
Added to title that this would also be useful for variables. |
Adding my suggestion from #1871 Is your feature request related to a problem? Please describe. var agentPoolProfiles = [
{
name: 'primary'
mode: 'System'
count: nodeCount
vmSize: vmSize
}
]
resource aksCluster 'Microsoft.ContainerService/managedClusters@2020-12-01' = {
name: clusterName
location: clusterLocation
properties: {
agentPoolProfiles: agentPoolProfiles
}
} Right now there's no completion or validation for that variable. Describe the solution you'd like I would like to be able to specify a schema for a variable, e.g. using the type name from Swagger: var agentPoolProfiles 'Microsoft.ContainerService/managedClusters@2020-12-01/ManagedClusterAgentPoolProfile[]' = [ |
Due to the lack of this function, it is difficult to use an object as a parameter. For those who use a template, I'm using the default to suggest a data structure. In that case, allow, secure, etc. cannot be used, which is quite inconvenient. |
@takekazuomi Why can't you use |
Example of bicep/docs/examples/101/aci-linuxcontainer-public-ip/main.bicep Lines 7 to 12 in 9b39718
|
I didn't have enough words. I'm currently using the default to suggest a property of type object.
However, in this case, I cannot use @Allowed or @Scure in default object values. It cannot be written as below.
The dedicated syntax for defining the structure of an object is useful. |
I think this is related to what was discussed in #622 |
I agree however if you look at the last comments we were discussing some approach how to define such types. I've just linked those two issues as they touches same mechanism in compiler. |
Closing and tracking with #4158 |
Suggestion: When creating bicep modules, could the "shape" of any object parameters be specified. I.e.
This would enable bicep to validate the usage of this parameter in the module and will also mean that VS Code can provide intellisense.
The text was updated successfully, but these errors were encountered: