ParameterRule

class ParameterRule : ValidationRule<Parameter> (source)

Functions

Link copied to clipboard
fun allowEmptyValue(description: String = "", rule: BooleanRule.() -> BooleanRule): ParameterRule
Link copied to clipboard
fun allowReserved(description: String = "", rule: BooleanRule.() -> BooleanRule): ParameterRule
Link copied to clipboard
fun content(description: String = "", rule: ContentRule.() -> ContentRule): ParameterRule
Link copied to clipboard
fun deprecated(description: String = "", rule: BooleanRule.() -> BooleanRule): ParameterRule
Link copied to clipboard
fun description(description: String = "", rule: StringRule.() -> StringRule): ParameterRule
Link copied to clipboard
fun <R : ValidationRule<Parameter>> R.either(vararg option: Parameter): 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<Parameter>> R.exactly(value: Parameter): R

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

Link copied to clipboard
fun example(description: String = "", rule: AnyRule.() -> AnyRule): ParameterRule
Link copied to clipboard
fun examples(description: String = "", rule: ExamplesRule.() -> ExamplesRule): ParameterRule
Link copied to clipboard
fun explode(description: String = "", rule: BooleanRule.() -> BooleanRule): ParameterRule
Link copied to clipboard
fun <R : ValidationRule<Parameter>> R.given(precondition: (Parameter?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

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

Validate that predicate evaluates to true.

Link copied to clipboard
fun in(description: String = "", rule: StringRule.() -> StringRule): ParameterRule
Link copied to clipboard
fun name(description: String = "", rule: StringRule.() -> StringRule): ParameterRule
Link copied to clipboard
fun <R : ValidationRule<Parameter>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

Link copied to clipboard
fun <V, R : ValidationRule<Parameter>> R.optional(value: (Parameter?) -> V?, rule: R.() -> R): R

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

Link copied to clipboard
fun required(description: String = "", rule: BooleanRule.() -> BooleanRule): ParameterRule
Link copied to clipboard
fun <R : ValidationRule<Parameter>> R.required(): R

Validate that the element is set.

Link copied to clipboard
fun schema(description: String = "", rule: SchemaRule.() -> SchemaRule): ParameterRule
Link copied to clipboard
fun <R : ValidationRule<Parameter>> R.since(date: LocalDate, rule: R.() -> R): R

Validate rule only if date has been in the past.

Link copied to clipboard
fun style(description: String = "", rule: EnumRule<Parameter.StyleEnum>.() -> EnumRule<Parameter.StyleEnum>): ParameterRule
Link copied to clipboard
fun <R : ValidationRule<Parameter>> R.unspecified(): R

Validate that the element is not set.

Link copied to clipboard
fun validate(fixture: Parameter?): ValidationResult

Execute the given rule(s) on the fixture.