Migration API validate rule for character limit


I’m trying to use the Migration CLI to apply a character limit validation to a field. Based on the API docs, I do not see how to add such a limit on characters for a field, similar to the end result from using the Contentful interface in the image below (adding a character limit of 65 characters):

The API docs do have a size property, but it specifically indicates it is only to be used for Array type fields to limit the number of references.

Any help would be appreciated!


Hey @dlorenzo,

you were on the right track - the size validation is what you’re looking for!

There’s a column “Applicable to” next to the description that states the types a validation can be used against, in this case it’s “Arrays, Text, Symbol” (A text basically is an array of characters).


1 Like

Ah great! Thanks, @stephan.schneider. I must’ve missed the seeing the rest of the “applicable to” cases :scream_cat:

Appreciate the help!