claude-code-proxy icon indicating copy to clipboard operation
claude-code-proxy copied to clipboard

JSON unmarshalling fails due to expecting type string and sometimes getting type Array

Open dproud opened this issue 4 months ago • 0 comments

❌ 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.

dproud avatar Aug 04 '25 00:08 dproud