Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime committed Jan 31, 2025
1 parent 70a784a commit a83347b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Sources/Postie/HTTP Method/RequestHTTPMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/// ```
/// @RequestHTTPMethod var httpMethod: HTTPMethod = .post
/// ```
@propertyWrapper public struct RequestHTTPMethod: Encodable {
@propertyWrapper
public struct RequestHTTPMethod: Encodable {
/// The wrapped value representing the HTTP method.
///
/// This property holds the `HTTPMethod` value that is managed by this property wrapper.
Expand Down
3 changes: 2 additions & 1 deletion Sources/Postie/Headers/ResponseHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/// ```
/// @ResponseHeader<CustomDecodingStrategy> var header: String
/// ```
@propertyWrapper public struct ResponseHeader<DecodingStrategy: ResponseHeaderDecodingStrategy> {
@propertyWrapper
public struct ResponseHeader<DecodingStrategy: ResponseHeaderDecodingStrategy> {
/// The wrapped value representing the decoded header value.
///
/// This property holds the `DecodingStrategy.RawValue` value that is managed by this property wrapper.
Expand Down
3 changes: 2 additions & 1 deletion Sources/Postie/Path/RequestPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/// ```
/// @RequestPath var path: String
/// ```
@propertyWrapper public struct RequestPath: Encodable {
@propertyWrapper
public struct RequestPath: Encodable {
/// The wrapped value representing the request path.
///
/// This property holds the `String` value that is managed by this property wrapper.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Postie/Responses/EmptyResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
///
/// Example usage:
/// ```
/// let emptyResponse = try JSONDecoder().decode(EmptyResponse.self, from: Data())
/// @ResponseBody<EmptyResponse> var responseBody
/// ```
public struct EmptyResponse: Decodable {}
2 changes: 0 additions & 2 deletions Sources/Postie/Responses/ResponseBody/ResponseBody.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A type alias for `ResponseBodyWrapper` with a default body decoding strategy.
///
/// The `ResponseBody` type alias provides a convenient way to use `ResponseBodyWrapper` with the `DefaultBodyStrategy`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ extension ResponseErrorBodyWrapper: Decodable {
///
/// - Parameter decoder: The decoder to use for decoding the error response body.
/// - Throws: An error if the decoder is not a `ResponseDecoding` instance or if the response body cannot be decoded.
///
/// Example usage:
/// ```
/// let errorResponseBody: MyErrorResponseType? = try ResponseErrorBodyWrapper(from: decoder)
/// ```
public init(from decoder: Decoder) throws {
guard let responseDecoder = decoder as? ResponseDecoding else {
self.wrappedValue = try Body(from: decoder)
Expand Down

0 comments on commit a83347b

Please sign in to comment.