Skip to content

Commit 495a63d

Browse files
committed
add a few more tidbits to the docs for the HttpMethod type
1 parent 0550e8a commit 495a63d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Sources/OpenAPIKitCore/Shared/HttpMethod.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ extension Shared {
99
/// Represents the HTTP methods supported by the
1010
/// OpenAPI Specification.
1111
///
12-
/// See [OpenAPI Path Item Object](https://spec.openapis.org/oas/v3.0.4.html#path-item-object) because the supported
13-
/// HTTP methods are enumerated as properties on that
12+
/// See [OpenAPI Path Item Object](https://spec.openapis.org/oas/v3.2.0.html#path-item-object)
13+
/// because the supported HTTP methods are enumerated as properties on that
1414
/// object.
1515
public enum BuiltinHttpMethod: String, CaseIterable, Sendable {
1616
case get = "GET"
@@ -24,6 +24,17 @@ extension Shared {
2424
case query = "QUERY"
2525
}
2626

27+
/// Represents an HTTP method.
28+
///
29+
/// See [OpenAPI Path Item Object](https://spec.openapis.org/oas/v3.2.0.html#path-item-object).
30+
///
31+
/// Methods are split into builtin methods (those representable as
32+
/// properties on a Path Item Object) and other methods (those that can be
33+
/// added to the `additionalOperations` of a Path Item Object).
34+
///
35+
/// `HttpMethod` is `ExpressibleByStringLiteral` so you can write a
36+
/// non-builtin method like "LINK" as:
37+
/// `let linkMethod : OpenAPI.HttpMethod = "LINK"`
2738
public enum HttpMethod: ExpressibleByStringLiteral, RawRepresentable, Equatable, Hashable, Codable, Sendable {
2839
case builtin(BuiltinHttpMethod)
2940
case other(String)

0 commit comments

Comments
 (0)