(Quick Reference)

size

Purpose

Uses a Groovy range to restrict the size of a collection, a number, or the length of a String.

Examples

children size: 5..15

Description

Sets the size of a collection, a number property, or String length.

Currently this constraint cannot be used in addition to blank or nullable. Use a custom validator for these combinations.

This constraint influences schema generation.

Error Code: className.propertyName.size.toosmall or className.propertyName.size.toobig