@@ -28,21 +28,23 @@ public protocol Endpoint {
2828 @available ( * , deprecated, message: " Encoding will be automatically determined by the kind of `parameters` in the future. " )
2929 var encoding : ParameterEncoding { get }
3030
31- /// Creates a URL by combining `path` with `baseUrl`.
31+ /// Creates a URL by resolving `path` over `baseUrl`.
32+ ///
3233 /// This function is a customization point for modifying the URL by current runtime,
3334 /// for example for API versioning or platform separation.
35+ ///
36+ /// Note that this function will be only called if the ``path`` resolved
37+ /// is a relative URL. If ``path`` specifies an absolute URL, it will be
38+ /// used instead, without any modifications.
39+ ///
3440 /// - Parameter baseUrl: Base URL for the request to combine with.
35- /// - Throws: If creating a concrete URL fails.
36- /// - Returns: URL for the request.
41+ /// - Returns: URL for the request or `nil` if such URL cannot be constructed.
3742 @NetworkActor func url( on baseUrl: URLConvertible ) async -> URL ?
3843
3944}
4045
41- @available ( * , deprecated, message: " Default values for deprecated properties " )
4246public extension Endpoint {
43-
44- var encoding : ParameterEncoding { AutomaticEncoding . default }
45-
47+
4648 @NetworkActor func url( on baseUrl: URLConvertible ) async -> URL ? {
4749 let baseUrl = await baseUrl. resolveUrl ( )
4850 let path = await path. resolveUrl ( )
@@ -53,6 +55,13 @@ public extension Endpoint {
5355
5456}
5557
58+ @available ( * , deprecated, message: " Default values for deprecated properties " )
59+ public extension Endpoint {
60+
61+ var encoding : ParameterEncoding { AutomaticEncoding . default }
62+
63+ }
64+
5665// MARK: - Parameters
5766
5867/// Enum that represents the data to be sent with the request,
0 commit comments