You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I often find myself implementing the following pattern in bicep - an input parameter and a map to convert it to another value. In this scenario the values in the @allowed() attribute and the properties on the map need to remain in sync.
This pattern mostly works fine, until adding a new value - it's too easy to update either the parameter allow list or the map without updating hte other.
Describe the solution you'd like
It would be really nice if bicep could automatically infer the @allowed() values for the environment input string. This would reduce duplication in the code, ensuring the values remained in sync.
Fixing #5045 would partially help resolve some of the pain of keeping values in sync as it should at least result in a compiler error if I updated the @allowed() attribute but forgot to update envShortNameMap, but it wouldn't help if I updated envShortNameMap without updating the @allowed() attribute
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I often find myself implementing the following pattern in bicep - an input parameter and a map to convert it to another value. In this scenario the values in the
@allowed()
attribute and the properties on the map need to remain in sync.This pattern mostly works fine, until adding a new value - it's too easy to update either the parameter allow list or the map without updating hte other.
Describe the solution you'd like
It would be really nice if bicep could automatically infer the
@allowed()
values for theenvironment
input string. This would reduce duplication in the code, ensuring the values remained in sync.Fixing #5045 would partially help resolve some of the pain of keeping values in sync as it should at least result in a compiler error if I updated the
@allowed()
attribute but forgot to updateenvShortNameMap
, but it wouldn't help if I updatedenvShortNameMap
without updating the@allowed()
attributeThe text was updated successfully, but these errors were encountered: