diff --git a/gopls/doc/commands.md b/gopls/doc/commands.md index b4b16ddd8a..65fa5c5ff7 100644 --- a/gopls/doc/commands.md +++ b/gopls/doc/commands.md @@ -286,16 +286,16 @@ Result: ``` { "Vuln": []{ - "id": string, - "details": string, - "aliases": []string, - "symbol": string, - "pkg_path": string, - "mod_path": string, - "url": string, - "current_version": string, - "fixed_version": string, - "call_stacks": [][]golang.org/x/tools/internal/lsp/command.StackEntry, + "ID": string, + "Details": string, + "Aliases": []string, + "Symbol": string, + "PkgPath": string, + "ModPath": string, + "URL": string, + "CurrentVersion": string, + "FixedVersion": string, + "CallStacks": [][]golang.org/x/tools/internal/lsp/command.StackEntry, }, } ``` diff --git a/internal/lsp/command/interface.go b/internal/lsp/command/interface.go index 8985adb8d5..9aecfbe780 100644 --- a/internal/lsp/command/interface.go +++ b/internal/lsp/command/interface.go @@ -350,35 +350,35 @@ type StackEntry struct { type Vuln struct { // ID is the vulnerability ID (osv.Entry.ID). // https://ossf.github.io/osv-schema/#id-modified-fields - ID string `json:"id,omitempty"` + ID string // Details is the description of the vulnerability (osv.Entry.Details). // https://ossf.github.io/osv-schema/#summary-details-fields - Details string `json:"details,omitempty"` + Details string `json:",omitempty"` // Aliases are alternative IDs of the vulnerability. // https://ossf.github.io/osv-schema/#aliases-field - Aliases []string `json:"aliases,omitempty"` + Aliases []string `json:",omitempty"` // Symbol is the name of the detected vulnerable function or method. - Symbol string `json:"symbol,omitempty"` + Symbol string `json:",omitempty"` // PkgPath is the package path of the detected Symbol. - PkgPath string `json:"pkg_path,omitempty"` + PkgPath string `json:",omitempty"` // ModPath is the module path corresponding to PkgPath. // TODO: how do we specify standard library's vulnerability? - ModPath string `json:"mod_path,omitempty"` + ModPath string `json:",omitempty"` // URL is the URL for more info about the information. // Either the database specific URL or the one of the URLs // included in osv.Entry.References. - URL string `json:"url,omitempty"` + URL string `json:",omitempty"` // Current is the current module version. - CurrentVersion string `json:"current_version,omitempty"` + CurrentVersion string `json:",omitempty"` // Fixed is the minimum module version that contains the fix. - FixedVersion string `json:"fixed_version,omitempty"` + FixedVersion string `json:",omitempty"` // Example call stacks. - CallStacks []CallStack `json:"call_stacks,omitempty"` + CallStacks []CallStack `json:",omitempty"` // TODO: import graph & module graph. } diff --git a/internal/lsp/source/api_json.go b/internal/lsp/source/api_json.go index f2aff107da..14140bb630 100755 --- a/internal/lsp/source/api_json.go +++ b/internal/lsp/source/api_json.go @@ -670,7 +670,7 @@ var GeneratedAPIJSON = &APIJSON{ Title: "Run vulncheck (experimental)", Doc: "Run vulnerability check (`govulncheck`).", ArgDoc: "{\n\t// Dir is the directory from which vulncheck will run from.\n\t\"Dir\": string,\n\t// Package pattern. E.g. \"\", \".\", \"./...\".\n\t\"Pattern\": string,\n}", - ResultDoc: "{\n\t\"Vuln\": []{\n\t\t\"id\": string,\n\t\t\"details\": string,\n\t\t\"aliases\": []string,\n\t\t\"symbol\": string,\n\t\t\"pkg_path\": string,\n\t\t\"mod_path\": string,\n\t\t\"url\": string,\n\t\t\"current_version\": string,\n\t\t\"fixed_version\": string,\n\t\t\"call_stacks\": [][]golang.org/x/tools/internal/lsp/command.StackEntry,\n\t},\n}", + ResultDoc: "{\n\t\"Vuln\": []{\n\t\t\"ID\": string,\n\t\t\"Details\": string,\n\t\t\"Aliases\": []string,\n\t\t\"Symbol\": string,\n\t\t\"PkgPath\": string,\n\t\t\"ModPath\": string,\n\t\t\"URL\": string,\n\t\t\"CurrentVersion\": string,\n\t\t\"FixedVersion\": string,\n\t\t\"CallStacks\": [][]golang.org/x/tools/internal/lsp/command.StackEntry,\n\t},\n}", }, { Command: "gopls.start_debugging",