-
Notifications
You must be signed in to change notification settings - Fork 125
Use Docc for documentation #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Motivation Documentation is nice, and we can help support users by providing useful clear docs. Modifications Add Docc to 5.6 and later builds Make sure symbol references work Add overview docs Result Nice rendering docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a bunch of nits
@@ -16,12 +16,21 @@ | |||
import NIOCore | |||
import NIOHTTP1 | |||
|
|||
/// A representation of a HTTP request for the Swift Concurrency HTTPClient API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A representation of a HTTP request for the Swift Concurrency HTTPClient API. | |
/// A representation of an HTTP request for the Swift Concurrency HTTPClient API. |
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | ||
public struct HTTPClientRequest { | ||
/// The request URL, including scheme and hostname. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also include the port?
@@ -34,6 +43,10 @@ public struct HTTPClientRequest { | |||
|
|||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | |||
extension HTTPClientRequest { | |||
/// A HTTP request body. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A HTTP request body. | |
/// An HTTP request body. |
@@ -54,10 +67,20 @@ extension HTTPClientRequest { | |||
|
|||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | |||
extension HTTPClientRequest.Body { | |||
/// Create a ``HTTPClientRequest/Body-swift.struct`` from a `ByteBuffer`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Create a ``HTTPClientRequest/Body-swift.struct`` from a `ByteBuffer`. | |
/// Create an ``HTTPClientRequest/Body-swift.struct`` from a `ByteBuffer`. |
public static func bytes(_ byteBuffer: ByteBuffer) -> Self { | ||
self.init(.byteBuffer(byteBuffer)) | ||
} | ||
|
||
/// Create a ``HTTPClientRequest/Body-swift.struct`` from a `RandomAccessCollection` of bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Create a ``HTTPClientRequest/Body-swift.struct`` from a `RandomAccessCollection` of bytes. | |
/// Create an ``HTTPClientRequest/Body-swift.struct`` from a `RandomAccessCollection` of bytes. |
public var body: Body | ||
|
||
/// A representation of the response body for a HTTP response. | ||
/// | ||
/// The body is streamed in as an `AsyncSequence` of `ByteBuffer`, where each `ByteBuffer` contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure about this one
/// The body is streamed in as an `AsyncSequence` of `ByteBuffer`, where each `ByteBuffer` contains | |
/// The body is streamed as an `AsyncSequence` of `ByteBuffer`, where each `ByteBuffer` contains |
@@ -65,6 +65,9 @@ let globalRequestID = ManagedAtomic(0) | |||
/// try client.syncShutdown() | |||
/// ``` | |||
public class HTTPClient { | |||
/// The `EventLoopGroup` in use by this `HTTPClient`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The `EventLoopGroup` in use by this `HTTPClient`. | |
/// The `EventLoopGroup` in use by this ``HTTPClient``. |
@@ -97,7 +99,7 @@ extension HTTPClient { | |||
} | |||
} | |||
|
|||
/// Represent HTTP request. | |||
/// Represents a HTTP request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Represents a HTTP request. | |
/// Represents an HTTP request. |
@@ -226,7 +228,7 @@ extension HTTPClient { | |||
} | |||
} | |||
|
|||
/// Represent HTTP response. | |||
/// Represents a HTTP response. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Represents a HTTP response. | |
/// Represents an HTTP response. |
Sources/AsyncHTTPClient/Utils.swift
Outdated
@@ -14,6 +14,10 @@ | |||
|
|||
import NIOCore | |||
|
|||
/// A ``HTTPClientResponseDelegate`` that wraps a callback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A ``HTTPClientResponseDelegate`` that wraps a callback. | |
/// An ``HTTPClientResponseDelegate`` that wraps a callback. |
Motivation
Documentation is nice, and we can help support users by providing useful
clear docs.
Modifications
Add Docc to 5.6 and later builds
Make sure symbol references work
Add overview docs
Result
Nice rendering docs