Skip to content

URLTemplate_Component

mattpolzin edited this page Jun 11, 2021 · 2 revisions

URLTemplate.Component

URL Template components are either variables that can take on different values depending on the context or they are constant unchanging parts of the URL.

public enum Component: Hashable, RawRepresentable 

Inheritance

Hashable, RawRepresentable

Initializers

init?(rawValue:)

Create a component from its raw value.

public init?(rawValue: String) 

A constant's raw value is just the constant part of the URL.

A variable's raw value is the name of the variable enclosed in curly braces.

Enumeration Cases

variable

case variable(name: String)

constant

case constant(String)

Properties

rawValue

Get a component's raw value.

public var rawValue: String 

A constant's raw value is just the constant part of the URL.

A variable's raw value is the name of the variable enclosed in curly braces.

variableName

Always nil for constants, but for variables, this will return the variable name without the surrounding curly braces that are just OpenAPI syntax. By contrast, the rawValue of a variable will contain the curly braces.

public var variableName: String? 
Types
Protocols
Global Functions
Extensions
Clone this wiki locally