chore: switch to guts for typescript types generation (#15801)

switch to guts for typescript type generation
omitempty vs null must now be explicit
This commit is contained in:
Steven Masley
2024-12-11 14:39:21 -06:00
committed by GitHub
parent 2ec2e8ae6d
commit 077e594856
36 changed files with 2125 additions and 1684 deletions
+5 -5
View File
@@ -131,7 +131,7 @@ func (r *HealthcheckReport) Summarize(docsURL string) []string {
// BaseReport holds fields common to various health reports.
type BaseReport struct {
Error *string `json:"error"`
Error *string `json:"error,omitempty"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []health.Message `json:"warnings"`
Dismissed bool `json:"dismissed"`
@@ -185,8 +185,8 @@ type DERPHealthReport struct {
// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.
Healthy bool `json:"healthy"`
Regions map[int]*DERPRegionReport `json:"regions"`
Netcheck *netcheck.Report `json:"netcheck"`
NetcheckErr *string `json:"netcheck_err"`
Netcheck *netcheck.Report `json:"netcheck,omitempty"`
NetcheckErr *string `json:"netcheck_err,omitempty"`
NetcheckLogs []string `json:"netcheck_logs"`
}
@@ -196,7 +196,7 @@ type DERPRegionReport struct {
Healthy bool `json:"healthy"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []health.Message `json:"warnings"`
Error *string `json:"error"`
Error *string `json:"error,omitempty"`
Region *tailcfg.DERPRegion `json:"region"`
NodeReports []*DERPNodeReport `json:"node_reports"`
}
@@ -207,7 +207,7 @@ type DERPNodeReport struct {
Healthy bool `json:"healthy"`
Severity health.Severity `json:"severity" enums:"ok,warning,error"`
Warnings []health.Message `json:"warnings"`
Error *string `json:"error"`
Error *string `json:"error,omitempty"`
Node *tailcfg.DERPNode `json:"node"`