Skip to content

JSONSchema_NumericContext

mattpolzin edited this page Sep 28, 2020 · 5 revisions

JSONSchema.NumericContext

The context that only applies to .number schemas.

public struct NumericContext: Equatable

Note: Although integers are numbers, `integer` schemas have their own context type. An `IntegerContext` *can* be asked for the `NumericContext` that would describe it via its `numericContext` property.

Inheritance

Decodable, Encodable, Equatable

Initializers

init(multipleOf:maximum:minimum:)

public init(multipleOf: Double? = nil, maximum: (Double, exclusive: Bool)? = nil, minimum: (Double, exclusive: Bool)? = nil)

init(multipleOf:maximum:minimum:)

internal init(multipleOf: Double?, maximum: Bound?, minimum: Bound?)

init(from:)

public init(from decoder: Decoder) throws

Properties

multipleOf

A numeric instance is valid only if division by this keyword's value results in an integer. Defaults to nil.

let multipleOf: Double?

maximum

let maximum: Bound?

minimum

let minimum: Bound?

Methods

combined(with:)

internal func combined(with other: JSONSchema.NumericContext) throws -> JSONSchema.NumericContext

validatedContext()

internal func validatedContext() throws -> JSONSchema.NumericContext

encode(to:)

public func encode(to encoder: Encoder) throws
Types
Protocols
Global Functions
Extensions

Clone this wiki locally