PathRule

class PathRule : ValidationRule<Pair<String, PathItem>> (source)

Functions

Link copied to clipboard
fun delete(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun description(description: String = "", rule: StringRule.() -> StringRule): PathRule
Link copied to clipboard
fun <R : ValidationRule<Pair<String, PathItem>>> R.either(vararg option: Pair<String, PathItem>): 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<Pair<String, PathItem>>> R.exactly(value: Pair<String, PathItem>): R

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

Link copied to clipboard
fun get(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun <R : ValidationRule<Pair<String, PathItem>>> R.given(precondition: (Pair<String, PathItem>?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

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

Validate that predicate evaluates to true.

Link copied to clipboard
fun <R : ValidationRule<Pair<String, PathItem>>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

Link copied to clipboard
fun operations(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun <V, R : ValidationRule<Pair<String, PathItem>>> R.optional(value: (Pair<String, PathItem>?) -> V?, rule: R.() -> R): R

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

Link copied to clipboard
fun options(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun parameters(description: String = "", rule: ParametersRule.() -> ParametersRule): PathRule
Link copied to clipboard
fun patch(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
Link copied to clipboard
fun post(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun put(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun <R : ValidationRule<Pair<String, PathItem>>> R.required(): R

Validate that the element is set.

Link copied to clipboard
fun servers(description: String = "", rule: ServersRule.() -> ServersRule): PathRule
Link copied to clipboard
fun <R : ValidationRule<Pair<String, PathItem>>> R.since(date: LocalDate, rule: R.() -> R): R

Validate rule only if date has been in the past.

Link copied to clipboard
fun summary(description: String = "", rule: StringRule.() -> StringRule): PathRule
Link copied to clipboard
fun trace(description: String = "", rule: OperationRule.() -> OperationRule): PathRule
Link copied to clipboard
fun <R : ValidationRule<Pair<String, PathItem>>> R.unspecified(): R

Validate that the element is not set.

Link copied to clipboard
fun validate(fixture: Pair<String, PathItem>?): ValidationResult

Execute the given rule(s) on the fixture.