fix(scripts/apitypings): force health.Message and health.Severity to correct types (#11043)

* Force typegen types for some fields of derp health report
* Explicitly allocate slices for RegionReport.{Errors,Warnings} to avoid nulls in API response
This commit is contained in:
Cian Johnston
2023-12-05 16:31:48 +00:00
committed by GitHub
parent a235644046
commit 2e4e0b2d2c
5 changed files with 24 additions and 18 deletions
+6
View File
@@ -945,6 +945,12 @@ func convertProxy(p database.WorkspaceProxy, status proxyhealth.ProxyStatus) cod
if status.Status == "" {
status.Status = proxyhealth.Unknown
}
if status.Report.Errors == nil {
status.Report.Errors = make([]string, 0)
}
if status.Report.Warnings == nil {
status.Report.Warnings = make([]string, 0)
}
return codersdk.WorkspaceProxy{
Region: convertRegion(p, status),
DerpEnabled: p.DerpEnabled,