SchemaRule

class SchemaRule : ValidationRule<Schema<*>> (source)

Functions

Link copied to clipboard
fun allOf(description: String = "", rule: SchemasRule.() -> SchemasRule): SchemaRule
Link copied to clipboard
fun anyOf(description: String = "", rule: SchemasRule.() -> SchemasRule): SchemaRule
Link copied to clipboard
fun deprecated(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
fun description(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.either(vararg option: Schema<*>): R

Validate that the element should be equal to one of the elements in option given that it is set.

Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.exactly(value: Schema<*>): R

Validate that the element should be equal to value given that it is set.

Link copied to clipboard
fun exclusiveMaximum(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
fun exclusiveMinimum(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
Link copied to clipboard
fun format(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.given(precondition: (Schema<*>?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.holds(message: (Schema<*>?) -> String = { "Was supposed to hold for '$it' but did not" }, predicate: (Schema<*>?) -> Boolean): R

Validate that predicate evaluates to true.

Link copied to clipboard
fun items(description: String = "", rule: SchemaRule.() -> SchemaRule): SchemaRule
Link copied to clipboard
fun maximum(description: String = "", rule: BigDecimalRule.() -> BigDecimalRule): SchemaRule
Link copied to clipboard
fun maxItems(description: String = "", rule: IntegerRule.() -> IntegerRule): SchemaRule
Link copied to clipboard
fun maxLength(description: String = "", rule: IntegerRule.() -> IntegerRule): SchemaRule
Link copied to clipboard
fun maxProperties(description: String = "", rule: IntegerRule.() -> IntegerRule): SchemaRule
Link copied to clipboard
fun minimum(description: String = "", rule: BigDecimalRule.() -> BigDecimalRule): SchemaRule
Link copied to clipboard
fun minItems(description: String = "", rule: IntegerRule.() -> IntegerRule): SchemaRule
Link copied to clipboard
fun minLength(description: String = "", rule: IntegerRule.() -> IntegerRule): SchemaRule
Link copied to clipboard
fun minProperties(description: String = "", rule: IntegerRule.() -> IntegerRule): SchemaRule
Link copied to clipboard
fun multipleOf(description: String = "", rule: BigDecimalRule.() -> BigDecimalRule): SchemaRule
Link copied to clipboard
fun name(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
fun not(description: String = "", rule: SchemaRule.() -> SchemaRule): SchemaRule
Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

Link copied to clipboard
fun nullable(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
fun oneOf(description: String = "", rule: SchemasRule.() -> SchemasRule): SchemaRule
Link copied to clipboard
fun <V, R : ValidationRule<Schema<*>>> R.optional(value: (Schema<*>?) -> V?, rule: R.() -> R): R

Validate rule only if the evaluated result of value is not null.

Link copied to clipboard
fun pattern(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
fun properties(description: String = "", rule: SchemasRule.() -> SchemasRule): SchemaRule
Link copied to clipboard
fun readOnly(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
fun ref(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
fun required(description: String = "", rule: IterableStringRule.() -> IterableStringRule): SchemaRule
Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.required(): R

Validate that the element is set.

Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.since(date: LocalDate, rule: R.() -> R): R

Validate rule only if date has been in the past.

Link copied to clipboard
fun title(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
fun type(description: String = "", rule: StringRule.() -> StringRule): SchemaRule
Link copied to clipboard
fun uniqueItems(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
fun <R : ValidationRule<Schema<*>>> R.unspecified(): R

Validate that the element is not set.

Link copied to clipboard
fun validate(fixture: Schema<*>?): ValidationResult

Execute the given rule(s) on the fixture.

Link copied to clipboard
fun writeOnly(description: String = "", rule: BooleanRule.() -> BooleanRule): SchemaRule
Link copied to clipboard
fun xml(description: String = "", rule: XMLRule.() -> XMLRule): SchemaRule