Teki
Rules

Max

Require a maximum value, length, or size.

Use max(...) to enforce an upper bound.

Teki schema = Teki.fromRules(
    string("username").max(24),
    number("score").max(100),
    array("tags").max(10)
);

Notes

null is rejected. Use optional() on the builder if the field may be absent.

Available on

  • string(...)
  • number(...)
  • array(...)
  • elements()

Annotation equivalent

import dev.ditsche.teki.annotation.Max;

public class ReviewRequest {
    @Max(500)
    private String comment;
}

On this page