Skip to content

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

@dproud

Description

@dproud

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions