RequestPath
@propertyWrapper
public struct RequestPath : Encodable
extension RequestPath: ExpressibleByStringLiteral, ExpressibleByExtendedGraphemeClusterLiteral, ExpressibleByUnicodeScalarLiteral
A property wrapper that provides a convenient way to handle request paths.
The RequestPath
struct is a property wrapper that allows you to specify the path for a request.
It wraps a String
value and provides a default value of an empty string.
Example usage:
@RequestPath var path: String
-
The wrapped value representing the request path.
This property holds the
String
value that is managed by this property wrapper.Declaration
Swift
public var wrappedValue: String
-
Initializes a new instance of
RequestPath
with the specified wrapped value.Example usage:
@RequestPath var path: String = "/api/v1/resource"
Declaration
Swift
public init(wrappedValue: String = "")
Parameters
wrappedValue
The wrapped value representing the request path. Defaults to an empty string.
-
Initializes a new instance of
RequestPath
with the specified string literal.Example usage:
@RequestPath var path: String = "/api/v1/resource"
Declaration
Swift
public init(stringLiteral value: String)
Parameters
value
The string literal to initialize the
RequestPath
with.