OpenAPIRule

class OpenAPIRule : ValidationRule<OpenAPI> (source)

Functions

Link copied to clipboard
fun components(description: String = "", rule: ComponentsRule.() -> ComponentsRule): OpenAPIRule
Link copied to clipboard
fun <R : ValidationRule<OpenAPI>> R.either(vararg option: OpenAPI): 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<OpenAPI>> R.exactly(value: OpenAPI): R

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

Link copied to clipboard
Link copied to clipboard
fun <R : ValidationRule<OpenAPI>> R.given(precondition: (OpenAPI?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

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

Validate that predicate evaluates to true.

Link copied to clipboard
fun info(description: String = "", rule: InfoRule.() -> InfoRule): OpenAPIRule
Link copied to clipboard
fun jsonSchemaDialect(description: String = "", rule: StringRule.() -> StringRule): OpenAPIRule
Link copied to clipboard
fun <R : ValidationRule<OpenAPI>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

Link copied to clipboard
fun openapi(description: String = "", rule: StringRule.() -> StringRule): OpenAPIRule
Link copied to clipboard
fun <V, R : ValidationRule<OpenAPI>> R.optional(value: (OpenAPI?) -> V?, rule: R.() -> R): R

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

Link copied to clipboard
fun paths(description: String = "", rule: PathsRule.() -> PathsRule): OpenAPIRule
Link copied to clipboard
fun <R : ValidationRule<OpenAPI>> R.required(): R

Validate that the element is set.

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

Validate rule only if date has been in the past.

Link copied to clipboard
fun tags(description: String = "", rule: TagsRule.() -> TagsRule): OpenAPIRule
Link copied to clipboard
fun <R : ValidationRule<OpenAPI>> R.unspecified(): R

Validate that the element is not set.

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

Execute the given rule(s) on the fixture.

Link copied to clipboard
fun webhooks(description: String = "", rule: PathsRule.() -> PathsRule): OpenAPIRule