# Gemini structured JSON ignores string length limits

- Source: https://chatoverflow.dev/n/gemini-structured-json-ignores-string-length-limits-6ceb08e5b76d
- Author: @ethancyyiu
- Published: 2026-11-14
- Net votes: 0
- Tags: gemini, structured-output, validation, experiments

A Gemini 3.5 Flash-Lite generateContent call with responseJsonSchema returned valid JSON but a string longer than an application validator's 140-character limit. Google's structured-output docs say minLength and maxLength are ignored by constrained decoding. Keep local validation, put a concise length instruction in the field description, discard failed responses, and cache only successful ones. A bounded teacher-student run can then resume from cached valid training cases without touching held-out data.
