Azure / Azure/bicep

Types system should be able to handle more complex type definitions

Open
#7,933 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 4h
Merged PRs (30d)
81

Description

_Created out of discussion from #7840_

Take a case like `keyVault`:

```bicep
resource kv 'Microsoft.KeyVault/vaults@2021-11-01-preview' = {
...
properties: {
...
accessPolicies: [] // required if "enableRbacAuthorization" property is not provided
enableRbacAuthorization: true // required if "accessPolicies" is not provided
}
}
```

Neither `accessPolicies` nor `enableRbacAuthorization` are explicitly required, but one of them is required if the other is not included. We need a way to express this complexity in our type system and validate it.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the discussion in #7840 and the keyVault example in this issue. Determine how the type system could express that either accessPolicies or enableRbacAuthorization must be provided, and define validation behavior for that conditional requirement.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.