Azure / Azure/bicep

User-defined types - Mandatory property based on value from another property

Open
#9,641 15 comments 1 reaction 0 assignees View on GitHub
enhancement Needs: Upvote type system
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**
Hi, is there a way to define property to be mandatory only if another property is set to certain value?
Also let's say I have property property1 that is not mandatory and has default value of foo1. The allowed values for property1 are foo1 and foo2. If the value is foo1 than property2 is mandatory if value is foo2, property 3 is mandatory. Also is there a way that if I do not define the value of property1 because it has default value to signal in intelliisense that property2 is mandatory?

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points; begin by reviewing the discussion around user-defined types and IntelliSense in the Bicep repository. Clarify the conditional rules, default-value behavior, diagnostics, and completion behavior before implementation. Done should include an agreed specification and corresponding tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
compilers, developer-experience
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.