Skip to content

JSONReference_InternalReference

mattpolzin edited this page Jun 14, 2020 · 6 revisions

JSONReference.InternalReference

The context for a JSONReference that points to something within the same document as the reference itself.

public enum InternalReference

By contrast, an "external" reference is represented by a URL that is expected to be resolved to a different file than one containing the JSONReference.

Inheritance

Equatable, Hashable, LosslessStringConvertible, RawRepresentable

Initializers

init?(_:)

public init?(_ description: String)

init?(rawValue:)

Create a Reference from a path fragment as defined in RFC 3986.

public init?(rawValue: String)

Important: The string must begin with the '\#' that denotes a URI "fragment" is to follow.

Enumeration Cases

component

The reference refers to a component (i.e. #/components/...).

case component(name: String)

path

The reference refers to some path outside the Components Object.

case path(: Path)

Properties

name

Get the name of the referenced object.

var name: String?

Note: If the last path component is an integer, its string representation will be returned. JSONReferences do not have a way to determine whether that is the name of a property or an index within an array without crawling the JSON path to determine if its parent is an array or an object.

This value will be nil if there are no path components (which can happen if the reference just points to the whole document).

description

Synonymous with rawValue.

var description: String

rawValue

A String formatted per the path fragment specification found in RFC 3986.

var rawValue: String
Types
Protocols
Global Functions
Extensions

Clone this wiki locally