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
Stringvalue that is managed by this property wrapper.Declaration
Swift
public var wrappedValue: String -
Initializes a new instance of
RequestPathwith the specified wrapped value.Example usage:
@RequestPath var path: String = "/api/v1/resource"Declaration
Swift
public init(wrappedValue: String = "")Parameters
wrappedValueThe wrapped value representing the request path. Defaults to an empty string.
-
Initializes a new instance of
RequestPathwith the specified string literal.Example usage:
@RequestPath var path: String = "/api/v1/resource"Declaration
Swift
public init(stringLiteral value: String)Parameters
valueThe string literal to initialize the
RequestPathwith.
View on GitHub