RequestPathParameter
@propertyWrapper
public struct RequestPathParameter<T> where T : RequestPathParameterValue
extension RequestPathParameter: Encodable where T: Encodable
extension RequestPathParameter: ExpressibleByNilLiteral where T: ExpressibleByNilLiteral
extension RequestPathParameter: ExpressibleByStringLiteral,
ExpressibleByExtendedGraphemeClusterLiteral,
ExpressibleByUnicodeScalarLiteral
where T == String
extension RequestPathParameter: ExpressibleByIntegerLiteral where T == IntegerLiteralType
A property wrapper that provides a convenient way to handle path parameters in a request.
Example usage:
@RequestPathParameter var userId: String
This property wrapper can be used to manage path parameters in a request.
-
The custom name of the path parameter, can be nil.
This property holds the custom name of the path parameter, which can be nil.
Declaration
Swift
public var name: String?
-
The wrapped value representing the path parameter value.
This property holds the wrapped value representing the path parameter value.
Declaration
Swift
public var wrappedValue: T
-
Initializes a new instance of
RequestPathParameter
with the specified wrapped value.Example usage:
@RequestPathParameter var userId: String = "123"
Declaration
Swift
public init(wrappedValue: T)
Parameters
wrappedValue
The wrapped value representing the path parameter value.
-
Initializes a new instance of
RequestPathParameter
with the specified name and default value.Example usage:
@RequestPathParameter(name: "userId") var userId: String = "123"
Declaration
Swift
public init(name: String?, defaultValue: T)
Parameters
name
The custom name of the path parameter, can be nil.
defaultValue
The default value representing the path parameter value.
-
Returns the type of the path parameter.
Declaration
Swift
public static func getParameterType() -> Any.Type
Return Value
The type of the path parameter.
-
Initializes a new instance of
RequestPathParameter
with the specified name and an empty string as the default value.Example usage:
@RequestPathParameter(name: "userId") var userId: String
Declaration
Swift
public init(name: String?)
Parameters
name
The custom name of the path parameter, can be nil.
-
Initializes a new instance of
RequestPathParameter
with the specified name and a default value of -1.Example usage:
@RequestPathParameter(name: "userId") var userId: Int
Declaration
Swift
public init(name: String?)
Parameters
name
The custom name of the path parameter, can be nil.
-
Initializes a new instance of
RequestPathParameter
with the specified name and a default value of -1.Example usage:
@RequestPathParameter(name: "userId") var userId: Int16
Declaration
Swift
public init(name: String?)
Parameters
name
The custom name of the path parameter, can be nil.
-
Initializes a new instance of
RequestPathParameter
with the specified name and a default value of -1.Example usage:
@RequestPathParameter(name: "userId") var userId: Int32
Declaration
Swift
public init(name: String?)
Parameters
name
The custom name of the path parameter, can be nil.
-
Initializes a new instance of
RequestPathParameter
with the specified name and a default value of -1.Example usage:
@RequestPathParameter(name: "userId") var userId: Int64
Declaration
Swift
public init(name: String?)
Parameters
name
The custom name of the path parameter, can be nil.
-
Declaration
Swift
public init(nilLiteral: ())
-
Declaration
Swift
public init(stringLiteral value: String)
-
Declaration
Swift
public init(integerLiteral value: IntegerLiteralType)