on main help sign in
fix: schema incorrectly marks optional fields as required (#1996)
99aabb0huaiyuWangh
internal/config/config.go+3−3
@@ -187,7 +187,7 @@ type MCPConfig struct {
187
187
188type LSPConfig struct {
188type LSPConfig struct {
189 Disabled bool `json:"disabled,omitempty" jsonschema:"description=Whether this LSP server is disabled,default=false"`
189 Disabled bool `json:"disabled,omitempty" jsonschema:"description=Whether this LSP server is disabled,default=false"`
190− Command string `json:"command,omitempty" jsonschema:"required,description=Command to execute for the LSP server,example=gopls"`
190+ Command string `json:"command,omitempty" jsonschema:"description=Command to execute for the LSP server,example=gopls"`
191 Args []string `json:"args,omitempty" jsonschema:"description=Arguments to pass to the LSP server command"`
191 Args []string `json:"args,omitempty" jsonschema:"description=Arguments to pass to the LSP server command"`
192 Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set to the LSP server command"`
192 Env map[string]string `json:"env,omitempty" jsonschema:"description=Environment variables to set to the LSP server command"`
193 FileTypes []string `json:"filetypes,omitempty" jsonschema:"description=File types this LSP server handles,example=go,example=mod,example=rs,example=c,example=js,example=ts"`
193 FileTypes []string `json:"filetypes,omitempty" jsonschema:"description=File types this LSP server handles,example=go,example=mod,example=rs,example=c,example=js,example=ts"`
@@ -347,7 +347,7 @@ type Agent struct {
347}
347}
348
348
349type Tools struct {
349type Tools struct {
350− Ls ToolLs `json:"ls,omitzero"`
350+ Ls ToolLs `json:"ls,omitempty"`
351}
351}
352
352
353type ToolLs struct {
353type ToolLs struct {
@@ -380,7 +380,7 @@ type Config struct {
380
380
381 Permissions *Permissions `json:"permissions,omitempty" jsonschema:"description=Permission settings for tool usage"`
381 Permissions *Permissions `json:"permissions,omitempty" jsonschema:"description=Permission settings for tool usage"`
382
382
383− Tools Tools `json:"tools,omitzero" jsonschema:"description=Tool configurations"`
383+ Tools Tools `json:"tools,omitempty" jsonschema:"description=Tool configurations"`
384
384
385 Agents map[string]Agent `json:"-"`
385 Agents map[string]Agent `json:"-"`
386
386
schema.json+3−12
@@ -92,10 +92,7 @@
92 }
92 }
93 },
93 },
94 "additionalProperties": false,
94 "additionalProperties": false,
95− "type": "object",
95+ "type": "object"
96− "required": [
97− "tools"
98− ]
99 },
96 },
100 "LSPConfig": {
97 "LSPConfig": {
101 "properties": {
98 "properties": {
@@ -162,10 +159,7 @@
162 }
159 }
163 },
160 },
164 "additionalProperties": false,
161 "additionalProperties": false,
165− "type": "object",
162+ "type": "object"
166− "required": [
167− "command"
168− ]
169 },
163 },
170 "LSPs": {
164 "LSPs": {
171 "additionalProperties": {
165 "additionalProperties": {
@@ -702,10 +696,7 @@
702 }
696 }
703 },
697 },
704 "additionalProperties": false,
698 "additionalProperties": false,
705− "type": "object",
699+ "type": "object"
706− "required": [
707− "ls"
708− ]
709 }
700 }
710 }
701 }
711}
702}