Azure / Azure/data-api-builder

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

Offen
#2,516 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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"]
}
}
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue nennt keine Datei und keinen Test; beginne damit, die JSON-Schema-Definition für die Telemetrie-Konfiguration application-insights zu finden. Überprüfe ihr Validierungsverhalten für enabled=false und enabled=true. Erledigt ist dies, wenn ein deaktivierter Block connection-string weglassen darf, während ein aktivierter Block es weiterhin erfordert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
backend-api-design
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
58/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.