Skip to content

l.any()

Always passes the type check. Use it for a field you want listed in a schema without constraints, or as the start of a chain that is only a custom validator: l.any().custom(...). Returns an AnyValidator<Object?>; .required() narrows it to Object.

AnyValidator<Object?> any()

Code none. Default message: l.any() has no type check, so it reports no issue of its own. l.any().required() reports value is required for null.

A dynamic, Object or Object? parameter maps to l.any(). dynamic never gets .required(), because dynamic admits null. A field with a JsonConverter or @JsonKey(fromJson:) is also validated as l.any(), because the generator cannot know the raw shape.

final payload = l.any();
payload.validate(input)+3-0
  1. valid: 42
  2. valid: null
  3. valid: {'k': 'v'}
[value is required]