Skip to content

Commit e2ca0fb

Browse files
committed
Fixing formatting issues
1 parent 59ca1fd commit e2ca0fb

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

Sources/_OpenAPIGeneratorCore/FeatureFlags.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
public enum FeatureFlag: String, Hashable, Codable, CaseIterable, Sendable {
2929
// needs to be here for the enum to compile
3030
case empty
31-
3231
/// UUID support
3332
///
3433
/// Enable interpretation of `type: string, format: uuid` as `Foundation.UUID` typed data.

Sources/_OpenAPIGeneratorCore/Translator/CommonTypes/Constants.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ enum Constants {
3838
ImportDescription(moduleName: Constants.Import.runtime, spi: "Generated"),
3939
ImportDescription(
4040
moduleName: "Foundation",
41-
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date", "struct Foundation.UUID"],
41+
moduleTypes: [
42+
"struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date",
43+
"struct Foundation.UUID",
44+
],
4245
preconcurrency: .onOS(["Linux"])
4346
),
4447
]

Sources/_OpenAPIGeneratorCore/Translator/FileTranslator+FeatureFlags.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ import OpenAPIKit
1515

1616
extension FileTranslator {
1717
// Add helpers for reading feature flags below.
18-
18+
1919
/// A boolean value indicating whether the `uuid` format on schemas should be followed.
20-
var supportUUIDFormat: Bool {
21-
config.featureFlags.contains(.uuidSupport)
22-
}
20+
var supportUUIDFormat: Bool { config.featureFlags.contains(.uuidSupport) }
2321
}

Sources/_OpenAPIGeneratorCore/Translator/FileTranslator.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ extension FileTranslator {
4848

4949
/// A new context from the file translator.
5050
var context: TranslatorContext {
51-
TranslatorContext(
52-
asSwiftSafeName: { $0.safeForSwiftCode },
53-
enableUUIDSupport: supportUUIDFormat
54-
)
51+
TranslatorContext(asSwiftSafeName: { $0.safeForSwiftCode }, enableUUIDSupport: supportUUIDFormat)
5552
}
5653
}
5754

@@ -63,7 +60,6 @@ struct TranslatorContext {
6360
/// - Parameter string: The string to convert to be safe for Swift.
6461
/// - Returns: A Swift-safe version of the input string.
6562
var asSwiftSafeName: (String) -> String
66-
6763
/// A variable that indicates the presence of the `uuidSupport` feature flag.
6864
var enableUUIDSupport: Bool
6965
}

Tests/OpenAPIGeneratorReferenceTests/SnippetBasedReferenceTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,6 @@ final class SnippetBasedReferenceTests: XCTestCase {
14621462
"""
14631463
)
14641464
}
1465-
14661465
func testComponentsSchemasUUID() throws {
14671466
try self.assertSchemasTranslation(
14681467
featureFlags: [.uuidSupport],

Tests/PetstoreConsumerTests/Test_Client.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ final class Test_Client: XCTestCase {
4646
)
4747
XCTAssertEqual(baseURL.absoluteString, "/api")
4848
XCTAssertEqual(request.method, .get)
49-
XCTAssertEqual(request.headerFields, [.accept: "application/json", .init("My-Request-UUID")!: requestUUID.uuidString])
49+
XCTAssertEqual(
50+
request.headerFields,
51+
[.accept: "application/json", .init("My-Request-UUID")!: requestUUID.uuidString]
52+
)
5053
XCTAssertNil(body)
5154
return try HTTPResponse(
5255
status: .ok,

Tests/PetstoreConsumerTests/Test_Server.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ final class Test_Server: XCTestCase {
3838
XCTAssertEqual(input.headers.My_hyphen_Request_hyphen_UUID, requestUUID)
3939
return .ok(
4040
.init(
41-
headers: .init(My_hyphen_Response_hyphen_UUID: responseUUID, My_hyphen_Tracing_hyphen_Header: "1234"),
41+
headers: .init(
42+
My_hyphen_Response_hyphen_UUID: responseUUID,
43+
My_hyphen_Tracing_hyphen_Header: "1234"
44+
),
4245
body: .json([.init(id: 1, name: "Fluffz")])
4346
)
4447
)

0 commit comments

Comments
 (0)