(快速參考)

大小

目的

使用 Groovy 範圍來限制集合、數字或字串長度的大小。

範例

children size: 5..15

說明

設定集合、數字屬性或字串長度的大小。

目前此約束無法與 空白可為空 一起使用。請使用自訂驗證器來進行這些組合。

此約束會影響 Schema 產生

錯誤代碼:className.propertyName.size.toosmallclassName.propertyName.size.toobig