Skip to content

Commit 812e757

Browse files
Commit via running ake Sources/git
1 parent e42299d commit 812e757

File tree

2 files changed

+18
-34
lines changed

2 files changed

+18
-34
lines changed

Sources/git/Client.swift

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,27 +1185,7 @@ public struct Client: APIProtocol {
11851185
case 204:
11861186
return .noContent(.init())
11871187
case 422:
1188-
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
1189-
let body: Components.Responses.validation_failed.Body
1190-
let chosenContentType = try converter.bestContentType(
1191-
received: contentType,
1192-
options: [
1193-
"application/json"
1194-
]
1195-
)
1196-
switch chosenContentType {
1197-
case "application/json":
1198-
body = try await converter.getResponseBodyAsJSON(
1199-
Components.Schemas.validation_hyphen_error.self,
1200-
from: responseBody,
1201-
transforming: { value in
1202-
.json(value)
1203-
}
1204-
)
1205-
default:
1206-
preconditionFailure("bestContentType chose an invalid content type.")
1207-
}
1208-
return .unprocessableContent(.init(body: body))
1188+
return .unprocessableContent(.init())
12091189
case 409:
12101190
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
12111191
let body: Components.Responses.conflict.Body

Sources/git/Types.swift

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,19 +1456,19 @@ public enum Components {
14561456
/// - Remark: Generated from `#/components/schemas/git-tree/sha`.
14571457
public var sha: Swift.String
14581458
/// - Remark: Generated from `#/components/schemas/git-tree/url`.
1459-
public var url: Swift.String
1459+
public var url: Swift.String?
14601460
/// - Remark: Generated from `#/components/schemas/git-tree/truncated`.
14611461
public var truncated: Swift.Bool
14621462
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload`.
14631463
public struct treePayloadPayload: Codable, Hashable, Sendable {
14641464
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload/path`.
1465-
public var path: Swift.String?
1465+
public var path: Swift.String
14661466
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload/mode`.
1467-
public var mode: Swift.String?
1467+
public var mode: Swift.String
14681468
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload/type`.
1469-
public var _type: Swift.String?
1469+
public var _type: Swift.String
14701470
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload/sha`.
1471-
public var sha: Swift.String?
1471+
public var sha: Swift.String
14721472
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload/size`.
14731473
public var size: Swift.Int?
14741474
/// - Remark: Generated from `#/components/schemas/git-tree/treePayload/url`.
@@ -1483,10 +1483,10 @@ public enum Components {
14831483
/// - size:
14841484
/// - url:
14851485
public init(
1486-
path: Swift.String? = nil,
1487-
mode: Swift.String? = nil,
1488-
_type: Swift.String? = nil,
1489-
sha: Swift.String? = nil,
1486+
path: Swift.String,
1487+
mode: Swift.String,
1488+
_type: Swift.String,
1489+
sha: Swift.String,
14901490
size: Swift.Int? = nil,
14911491
url: Swift.String? = nil
14921492
) {
@@ -1523,7 +1523,7 @@ public enum Components {
15231523
/// - tree: Objects specifying a tree structure
15241524
public init(
15251525
sha: Swift.String,
1526-
url: Swift.String,
1526+
url: Swift.String? = nil,
15271527
truncated: Swift.Bool,
15281528
tree: Components.Schemas.git_hyphen_tree.treePayload
15291529
) {
@@ -3867,17 +3867,21 @@ public enum Operations {
38673867
}
38683868
}
38693869
}
3870-
/// Validation failed, or the endpoint has been spammed.
3870+
public struct UnprocessableContent: Sendable, Hashable {
3871+
/// Creates a new `UnprocessableContent`.
3872+
public init() {}
3873+
}
3874+
/// Validation failed, an attempt was made to delete the default branch, or the endpoint has been spammed.
38713875
///
38723876
/// - Remark: Generated from `#/paths//repos/{owner}/{repo}/git/refs/{ref}/delete(git/delete-ref)/responses/422`.
38733877
///
38743878
/// HTTP response code: `422 unprocessableContent`.
3875-
case unprocessableContent(Components.Responses.validation_failed)
3879+
case unprocessableContent(Operations.git_sol_delete_hyphen_ref.Output.UnprocessableContent)
38763880
/// The associated value of the enum case if `self` is `.unprocessableContent`.
38773881
///
38783882
/// - Throws: An error if `self` is not `.unprocessableContent`.
38793883
/// - SeeAlso: `.unprocessableContent`.
3880-
public var unprocessableContent: Components.Responses.validation_failed {
3884+
public var unprocessableContent: Operations.git_sol_delete_hyphen_ref.Output.UnprocessableContent {
38813885
get throws {
38823886
switch self {
38833887
case let .unprocessableContent(response):

0 commit comments

Comments
 (0)