Azure / Azure/bicep

Harsh error behavior with bicepconfig.json files with unexpected types

Open
#6,439 0 comments 0 reactions 0 assignees View on GitHub
bug devdiv
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

# Repro 1
## bicepconfig.json
```json
{
"analyzers": "whoops"
}
```
## main.bicep
```bicep
param test string = 'abc'
```
Hover over param 'test' definition
!)
image
# Repro 2
Use this bicepconfig.json file:
```json
{
"analyzers": {
"core": {
"rules": {
"no-unused-params": {
"level": {
}
}
}
}
}
}
```
You get similar behavior
# Repro 3
The same happens from the command line:
image
# NOTE
Malformed JSON is handled better:
## bicepconfig.json
```json
{
```
gives
image

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the three cases using the bicepconfig.json and main.bicep examples, both through parameter hover and the command line. Compare unexpected JSON types with the existing malformed-JSON handling. Done means invalid configuration types produce a useful diagnostic or graceful error instead of the harsh behavior shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.