Skip to content

Commit c24569e

Browse files
authored
Changes required by docc (#549)
1 parent 3c205e8 commit c24569e

21 files changed

+47
-36
lines changed

Sources/Hummingbird/Codable/CodableProtocols.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public protocol ResponseEncoder {
2121
/// - Parameters:
2222
/// - value: value to encode
2323
/// - request: request that generated this value
24+
/// - context: Request context
2425
func encode(_ value: some Encodable, from request: Request, context: some RequestContext) throws -> Response
2526
}
2627

@@ -30,5 +31,6 @@ public protocol RequestDecoder {
3031
/// - Parameters:
3132
/// - type: type to decode to
3233
/// - request: request
34+
/// - context: Request context
3335
func decode<T: Decodable>(_ type: T.Type, from request: Request, context: some RequestContext) async throws -> T
3436
}

Sources/Hummingbird/Codable/JSON/JSONCoding.swift

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ extension JSONEncoder: ResponseEncoder {
2222
/// - Parameters:
2323
/// - value: Value to encode
2424
/// - request: Request used to generate response
25+
/// - context: Request context
2526
public func encode(_ value: some Encodable, from request: Request, context: some RequestContext) throws -> Response {
2627
let data = try self.encode(value)
2728
let buffer = ByteBuffer(data: data)
@@ -41,6 +42,7 @@ extension JSONDecoder: RequestDecoder {
4142
/// - Parameters:
4243
/// - type: Type to decode
4344
/// - request: Request to decode from
45+
/// - context: Request context
4446
public func decode<T: Decodable>(_ type: T.Type, from request: Request, context: some RequestContext) async throws -> T {
4547
let buffer = try await request.body.collect(upTo: context.maxUploadSize)
4648
return try self.decode(T.self, from: buffer)

Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedForm+Request.swift

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extension URLEncodedFormEncoder: ResponseEncoder {
1717
/// - Parameters:
1818
/// - value: Value to encode
1919
/// - request: Request used to generate response
20+
/// - context: Request context
2021
public func encode(_ value: some Encodable, from request: Request, context: some RequestContext) throws -> Response {
2122
let string = try self.encode(value)
2223
let buffer = ByteBuffer(string: string)
@@ -36,6 +37,7 @@ extension URLEncodedFormDecoder: RequestDecoder {
3637
/// - Parameters:
3738
/// - type: Type to decode
3839
/// - request: Request to decode from
40+
/// - context: Request context
3941
public func decode<T: Decodable>(_ type: T.Type, from request: Request, context: some RequestContext) async throws -> T {
4042
let buffer = try await request.body.collect(upTo: context.maxUploadSize)
4143
let string = String(buffer: buffer)

Sources/Hummingbird/Codable/URLEncodedForm/URLEncodedFormEncoder.swift

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public struct URLEncodedFormEncoder: Sendable {
6565
/// - Parameters:
6666
/// - dateEncodingStrategy: date encoding strategy
6767
/// - userInfo: user info to supply to encoder
68+
/// - additionalKeys: Deprecated variable
6869
public init(
6970
dateEncodingStrategy: URLEncodedFormEncoder.DateEncodingStrategy = .deferredToDate,
7071
userInfo: [CodingUserInfoKey: Sendable] = [:],

Sources/Hummingbird/Exports.swift

+12-12
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
@_exported import struct HummingbirdCore.BindAddress
16-
@_exported import struct HummingbirdCore.Request
17-
@_exported import struct HummingbirdCore.RequestBody
18-
@_exported import struct HummingbirdCore.Response
19-
@_exported import struct HummingbirdCore.ResponseBody
20-
@_exported import protocol HummingbirdCore.ResponseBodyWriter
15+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.BindAddress
16+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.Request
17+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.RequestBody
18+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.Response
19+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.ResponseBody
20+
@_exported @_documentation(visibility: internal) import protocol HummingbirdCore.ResponseBodyWriter
2121
#if canImport(Network)
22-
@_exported import struct HummingbirdCore.TSTLSOptions
22+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.TSTLSOptions
2323
#endif
2424

2525
@_exported @_documentation(visibility: internal) import struct NIOCore.ByteBuffer
@@ -30,8 +30,8 @@
3030
@_exported @_documentation(visibility: internal) import struct HTTPTypes.HTTPResponse
3131

3232
// Temporary exports of unavailable typealiases
33-
@_exported import struct HummingbirdCore.HBRequest
34-
@_exported import struct HummingbirdCore.HBRequestBody
35-
@_exported import struct HummingbirdCore.HBResponse
36-
@_exported import struct HummingbirdCore.HBResponseBody
37-
@_exported import protocol HummingbirdCore.HBResponseBodyWriter
33+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.HBRequest
34+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.HBRequestBody
35+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.HBResponse
36+
@_exported @_documentation(visibility: internal) import struct HummingbirdCore.HBResponseBody
37+
@_exported @_documentation(visibility: internal) import protocol HummingbirdCore.HBResponseBodyWriter

Sources/Hummingbird/Files/FileIO.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct FileIO: Sendable {
2222
let fileIO: NonBlockingFileIO
2323

2424
/// Initialize FileIO
25-
/// - Parameter application: application using FileIO
25+
/// - Parameter threadPool: ThreadPool to use for file operations
2626
public init(threadPool: NIOThreadPool = .singleton) {
2727
self.fileIO = .init(threadPool: threadPool)
2828
}
@@ -73,7 +73,7 @@ public struct FileIO: Sendable {
7373
/// - Parameters:
7474
/// - contents: AsyncSequence of buffers to write.
7575
/// - path: Path to write to
76-
/// - logger: Logger
76+
/// - context: Request Context
7777
public func writeFile<AS: AsyncSequence>(
7878
contents: AS,
7979
path: String,
@@ -90,9 +90,9 @@ public struct FileIO: Sendable {
9090
/// Write contents of buffer to file
9191
///
9292
/// - Parameters:
93-
/// - contents: ByteBuffer to write.
93+
/// - buffer: ByteBuffer to write.
9494
/// - path: Path to write to
95-
/// - logger: Logger
95+
/// - context: Request Context
9696
public func writeFile(
9797
buffer: ByteBuffer,
9898
path: String,

Sources/Hummingbird/Files/LocalFileSystem.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public struct LocalFileSystem: FileProvider {
8080
}
8181

8282
/// Get file attributes
83-
/// - Parameter id: FileIdentifier
83+
/// - Parameter path: FileIdentifier
8484
/// - Returns: File attributes
8585
public func getAttributes(id path: FileIdentifier) async throws -> FileAttributes? {
8686
do {
@@ -103,7 +103,7 @@ public struct LocalFileSystem: FileProvider {
103103

104104
/// Return a reponse body that will write the file body
105105
/// - Parameters:
106-
/// - id: FileIdentifier
106+
/// - path: FileIdentifier
107107
/// - context: Request context
108108
/// - Returns: Response body
109109
public func loadFile(id path: FileIdentifier, context: some RequestContext) async throws -> ResponseBody {
@@ -112,7 +112,7 @@ public struct LocalFileSystem: FileProvider {
112112

113113
/// Return a reponse body that will write a partial file body
114114
/// - Parameters:
115-
/// - id: FileIdentifier
115+
/// - path: FileIdentifier
116116
/// - range: Part of file to return
117117
/// - context: Request context
118118
/// - Returns: Response body

Sources/Hummingbird/HTTP/Cookie.swift

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public struct Cookie: Sendable, CustomStringConvertible {
5555
/// - path: The scope of each cookie is limited to a set of paths, controlled by the Path attribute
5656
/// - secure: The Secure attribute limits the scope of the cookie to "secure" channels
5757
/// - httpOnly: The HttpOnly attribute limits the scope of the cookie to HTTP requests
58-
/// - sameSite: The SameSite attribute lets servers specify whether/when cookies are sent with cross-origin requests
5958
public init(
6059
name: String,
6160
value: String,

Sources/Hummingbird/HTTP/MediaType.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public struct MediaType: Sendable, CustomStringConvertible {
141141
/// Get media type from a file extension
142142
/// - Parameter extension: file extension
143143
/// - Returns: media type
144-
public static func getMediaType(forExtension: String) -> MediaType? {
145-
return extensionMediaTypeMap[forExtension]
144+
public static func getMediaType(forExtension extension: String) -> MediaType? {
145+
return extensionMediaTypeMap[`extension`]
146146
}
147147

148148
/// Media type categories

Sources/Hummingbird/Middleware/FileMiddleware.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public struct FileMiddleware<Context: RequestContext, Provider: FileProvider>: R
7878
/// - fileProvider: File provider
7979
/// - urlBasePath: Prefix to remove from request URL
8080
/// - cacheControl: What cache control headers to include in response
81-
/// - indexHtml: Should we look for index.html in folders
81+
/// - searchForIndexHtml: Should we look for index.html in folders
8282
public init(
8383
fileProvider: Provider,
8484
urlBasePath: String? = nil,

Sources/Hummingbird/Router/RouteCollection.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public final class RouteCollection<Context: RequestContext>: RouterMethods {
5757

5858
extension RouterMethods {
5959
/// Add route collection to router
60-
/// - Parameter collection: Route collection
60+
/// - Parameters
61+
/// - collection: Route collection
62+
/// - path: Root path to add routes to
6163
@discardableResult public func addRoutes(_ collection: RouteCollection<Context>, atPath path: RouterPath = "") -> Self {
6264
for route in collection.routes {
6365
// ensure path starts with a "/" and doesn't end with a "/"

Sources/Hummingbird/Router/RouterMethods.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ extension RouterMethods {
9696
/// ```
9797
/// This gives a slight performance boost over adding them individually.
9898
///
99-
/// - Parameter middlewareStack: Middleware stack result builder
99+
/// - Parameter buildMiddlewareStack: Middleware stack result builder
100100
/// - Returns: router
101101
@discardableResult public func addMiddleware(
102102
@MiddlewareFixedTypeBuilder<Request, Response, Context> buildMiddlewareStack: () -> some MiddlewareProtocol<Request, Response, Context>

Sources/Hummingbird/Router/RouterResponder.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ public struct RouterResponder<Context: RequestContext>: HTTPResponder {
3636
}
3737

3838
/// Respond to request by calling correct handler
39-
/// - Parameter request: HTTP request
40-
/// - Returns: EventLoopFuture that will be fulfilled with the Response
39+
/// - Parameters
40+
/// - request: HTTP request
41+
/// - context: Request context
42+
/// - Returns: Response
4143
@inlinable
4244
public func respond(to request: Request, context: Context) async throws -> Response {
4345
do {

Sources/Hummingbird/Server/Request.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ extension Request {
2929
}
3030

3131
/// Decode request using decoder stored at `Application.decoder`.
32-
/// - Parameter type: Type you want to decode to
32+
/// - Parameters
33+
/// - type: Type you want to decode to
34+
/// - context: Request context
3335
public func decode<Type: Decodable>(as type: Type.Type, context: some RequestContext) async throws -> Type {
3436
do {
3537
return try await context.requestDecoder.decode(type, from: self, context: context)

Sources/Hummingbird/Storage/PersistDriver.swift

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ extension PersistDriver {
6262
/// - Parameters:
6363
/// - key: Key to store value against
6464
/// - value: Codable value to store
65-
/// - expires: If non-nil defines time that value will expire
6665
public func set(key: String, value: some Codable & Sendable) async throws {
6766
try await self.set(key: key, value: value, expires: nil)
6867
}

Sources/HummingbirdCore/Request/Request.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public struct Request: Sendable {
3838
/// - Parameters:
3939
/// - head: HTTP head
4040
/// - body: HTTP body
41-
/// - id: Unique RequestID
4241
public init(
4342
head: HTTPRequest,
4443
body: RequestBody
@@ -54,7 +53,7 @@ public struct Request: Sendable {
5453
/// you don't need to store the collated ByteBuffer on the request then use
5554
/// `request.body.collect(maxSize:)`.
5655
///
57-
/// - Parameter upTo: Maxiumum size of body to collect
56+
/// - Parameter maxSize: Maxiumum size of body to collect
5857
/// - Returns: Collated body
5958
public mutating func collectBody(upTo maxSize: Int) async throws -> ByteBuffer {
6059
let byteBuffer = try await self.body.collect(upTo: maxSize)

Sources/HummingbirdCore/Server/HTTP/HTTP1Channel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public struct HTTP1Channel: ServerChildChannel, HTTPChannelHandler {
6060

6161
/// handle HTTP messages being passed down the channel pipeline
6262
/// - Parameters:
63-
/// - value: Object to process input/output on child channel
63+
/// - asyncChannel: NIOAsyncChannel handling HTTP parts
6464
/// - logger: Logger to use while processing messages
6565
public func handle(
6666
value asyncChannel: NIOCore.NIOAsyncChannel<HTTPRequestPart, HTTPResponsePart>,

Sources/HummingbirdRouter/ContextTransform.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public struct ContextTransform<Context: RouterRequestContext, HandlerContext: Ro
3838

3939
/// Create RouteGroup from result builder
4040
/// - Parameters:
41-
/// - routerPath: Path local to group route this group is defined in
41+
/// - context: RequestContext to convert to
4242
/// - builder: RouteGroup builder
4343
public init(
4444
to context: HandlerContext.Type,

Sources/HummingbirdRouter/RouterBuilder.swift

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public struct RouterBuilder<Context: RouterRequestContext, Handler: MiddlewarePr
3737
/// Initialize RouterBuilder with contents of result builder
3838
/// - Parameters:
3939
/// - context: Request context used by router
40+
/// - options: Router options
4041
/// - builder: Result builder for router
4142
public init(
4243
context: Context.Type = Context.self,

Sources/HummingbirdTesting/Application+Test.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ extension ApplicationProtocol {
7272
/// ```
7373
///
7474
/// - Parameters:
75-
/// - testing: indicates which type of testing framework we want
76-
/// - configuration: configuration of application
75+
/// - testingSetup: indicates which type of testing framework we want
76+
/// - test: test function
7777
public func test<Value>(
7878
_ testingSetup: TestingSetup,
7979
_ test: @escaping @Sendable (any TestClientProtocol) async throws -> Value

Sources/HummingbirdTesting/TestClient.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public struct TestClient: Sendable {
5555
/// - Parameters:
5656
/// - host: host to connect
5757
/// - port: port to connect to
58-
/// - tlsConfiguration: TLS configuration if required
58+
/// - configuration: Client configuration
5959
/// - eventLoopGroupProvider: EventLoopGroup to use
6060
public init(
6161
host: String,

0 commit comments

Comments
 (0)