SCHEMA SIGNAL NOTES
Why Gemini maxLength needs application validation
A schema asks for a string of at most five characters. A six-character value can still have the correct JSON shape. The current Google structured-output guide documents length constraints as ignored during constrained decoding.
{ "type": "string", "maxLength": 5 }The original local schema rejects "123456". Removing only maxLength makes that value pass the local check. This is a constructed counterexample, not a captured model response.
Keep the original schema
Validate parsed values in your application and handle invalid output. Deleting a rule from a request does not make the underlying requirement disappear. SDK helper behavior can differ, so inspect the specific path you use.
Schema Signal also illustrates uniqueness and object-count cases. It does not test API acceptance, and it does not assess every keyword. See the dated method and limits.