Skip to content

Unknown request validation error returned from API #512

@nikolaydubina

Description

@nikolaydubina

we getting error that does not specify which field is causing problems. it is very hard to debug why GenAI is rejecting our request (probably it is divergence of GenAI from JSON Schema spec again, probably it is string in number again, but we do not know for sure...)

Error 400, Message: Request contains an invalid argument., Status: INVALID_ARGUMENT, Details: []
Image

go.mod

	google.golang.org/api v0.249.0
	google.golang.org/genai v1.24.0
	google.golang.org/grpc v1.75.1
	google.golang.org/protobuf v1.36.9

UPD:

we removed all minItems and maxItems from JSON Schema, and now requests succeeds.
before (2025-09-01 ~ 2025-09-12) we encoded this as json:"string". however now 2025-09-12 Vertex GenAI rejects "string", yet go-genai package is still requires this to be "string" in Go struct, and we cannot pass minItems as int

go-genai package is broken and out of sync with GenAI VertexAI API. so we have no choice but to not to supply any arguments like that for our JSON response schema. this degrades our AI usage quality. hope this will be fixed ASAP

Metadata

Metadata

Labels

api:gemini-apiIssues related to Gemini APIpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions