mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -867,10 +867,14 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
|
||||
return TypescriptType{ValueType: "Record<string, string>"}, nil
|
||||
case "github.com/coder/coder/v2/cli/clibase.URL":
|
||||
return TypescriptType{ValueType: "string"}, nil
|
||||
// XXX: For some reason, the type generator generates this as `any`
|
||||
// XXX: For some reason, the type generator generates these as `any`
|
||||
// so explicitly specifying the correct generic TS type.
|
||||
case "github.com/coder/coder/v2/codersdk.RegionsResponse[github.com/coder/coder/v2/codersdk.WorkspaceProxy]":
|
||||
return TypescriptType{ValueType: "RegionsResponse<WorkspaceProxy>"}, nil
|
||||
case "github.com/coder/coder/v2/coderd/healthcheck/health.Message":
|
||||
return TypescriptType{ValueType: "HealthMessage"}, nil
|
||||
case "github.com/coder/coder/v2/coderd/healthcheck/health.Severity":
|
||||
return TypescriptType{ValueType: "HealthSeverity"}, nil
|
||||
}
|
||||
|
||||
// Some hard codes are a bit trickier.
|
||||
|
||||
Reference in New Issue
Block a user