Skip to main content

String Length Constraint Violation

yaml
A string value is shorter or longer than the schema’s length constraint allows.

Q-1-29 — String Length Constraint Violation

A string value is shorter or longer than the schema’s length constraint allows.

What this means

A schema can require that a string property be at least N characters long, at most M characters long, or both. This error fires when your string falls outside that range.

The terminal message names the actual length and the bound that was violated — either “less than minimum N” or “greater than maximum N”.

Why this happens

The pattern usually appears on properties where the schema models an identifier, abbreviation, or other field with a known shape:

  • An empty string in a slot that requires a non-empty value (for example, an identifier or short name).
  • A field shortened past a minimum because of an editor’s auto-trim or an upstream pipeline truncating values.
  • A field padded past a maximum because of accidental concatenation or a value imported from a longer-form source.

How to fix

Adjust the value to fit the bound named in the error. If the constraint feels wrong for your case — for example, the schema demands a length your input legitimately cannot meet — the property may not be the right slot for the value, or the schema may need to be relaxed.