claude-code-proxy
claude-code-proxy copied to clipboard
JSON unmarshalling fails due to expecting type string and sometimes getting type Array
❌ Error parsing JSON: json: cannot unmarshal array into Go struct field Property.tools.input_schema.properties.type of type string
The issue is that the Property struct in models.go is defined with Type as a string, but in reality it can be a string OR an Array.
I fixed this by changing
type Property struct {
Type string `json:"type"`
Description string `json:"description"`
}
to
type Property struct {
Type interface{} `json:"type"`
Description string `json:"description"`
}
Everything seems to be working but I also don't fully understand the implications of this change.