Skip to content

JSONSchema_IntegerContext

mattpolzin edited this page Jun 11, 2021 · 5 revisions

JSONSchema.IntegerContext

The context that only applies to .integer schemas.

public struct IntegerContext: Equatable 

Inheritance

Decodable, Encodable, Equatable

Initializers

init(multipleOf:maximum:minimum:)

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

init?(from:)

Create an IntegerContext from the given NumericContext.

public init?(from numericContext: NumericContext) 

This will only succeed if all properties of the NumericContext are integers.

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.

public let multipleOf: Int?

maximum

public let maximum: Bound?

minimum

public let minimum: Bound?

numericContext

Get the NumericContext that describes this IntegerContext.

public var numericContext: NumericContext 

Methods

encode(to:)

public func encode(to encoder: Encoder) throws 
Types
Protocols
Global Functions
Extensions
Clone this wiki locally