Skip to content

JSONSchema_ArrayContext

mattpolzin edited this page Sep 28, 2020 · 4 revisions

JSONSchema.ArrayContext

The context that only applies to .array schemas.

public struct ArrayContext: Equatable

Inheritance

Decodable, Encodable, Equatable

Initializers

init(items:maxItems:minItems:uniqueItems:)

public init(items: JSONSchema? = nil, maxItems: Int? = nil, minItems: Int? = nil, uniqueItems: Bool? = nil)

init(from:)

public init(from decoder: Decoder) throws

Properties

items

A JSON Type Node that describes the type of each element in the array.

let items: JSONSchema?

maxItems

Maximum number of items in array.

let maxItems: Int?

_minItems

let _minItems: Int?

minItems

Minimum number of items in array. Defaults to 0.

var minItems: Int

_uniqueItems

let _uniqueItems: Bool?

uniqueItems

Setting to true indicates all elements of the array are expected to be unique. Defaults to false.

var uniqueItems: Bool

Methods

combined(with:)

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

validatedContext()

internal func validatedContext() throws -> JSONSchema.ArrayContext

encode(to:)

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