Azure / Azure/data-api-builder

🥕[Bug]: JSON Schema: Application Insights Connection String is Required

Aperta
#2,516 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.5k
Fork
370
Merge medio
3g 22h
PR unite (30g)
9

Descrizione

The `application-insights` section of the configuration requires a `connection-string` whenever the section exists, even if `"enabled": false`. The property is usually missing entirely in most configurations, but as soon as you include the `application-insights` block, even with telemetry disabled, the schema forces you to provide a `connection-string`. This makes no sense for developers trying to opt out of telemetry cleanly.

## Example

This configuration is invalid though it should be valid.

```json
{
"telemetry": {
"application-insights": {
"enabled": false
}
}
}
```

Instead, this is required. A silly friction for the developer.

```json
{
"telemetry": {
"application-insights": {
"enabled": false,
"connection-string": "dummy-value"
}
}
}
```

## Recommendation

Fix the schema so `connection-string` is only required when `enabled` is `true`.

```json
{
"if": {
"properties": { "enabled": { "const": true } }
},
"then": {
"required": ["connection-string"]
}
}
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

L'issue non indica alcun file o test; inizia individuando la definizione JSON Schema per la configurazione della telemetria application-insights. Verifica il relativo comportamento di validazione per enabled=false ed enabled=true. Il lavoro è completato quando un blocco disabilitato può omettere connection-string, mentre un blocco abilitato continua a richiederlo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
backend-api-design
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.