Skip to content

Commit 0e6faec

Browse files
authored
Fix PR CI - formatting (#824)
At some point recently (I only noticed it in https://github.com/apple/swift-openapi-generator/actions/runs/17734822822/job/50426205189?pr=816) we started getting failures in PR CI due to formatting issues in a test and in example projects. This PR fixes them up.
1 parent 340ee95 commit 0e6faec

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Examples/type-overrides-example/Sources/TypeOverrides/CustomPrimeNumber.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
/// Example struct to be used instead of the default generated type.
1616
/// This illustrates how to introduce a type performing additional validation during Decoding that cannot be expressed with OpenAPI
17-
public struct CustomPrimeNumber: Codable, Hashable, RawRepresentable, Sendable {
18-
public let rawValue: Int
19-
public init?(rawValue: Int) {
17+
struct CustomPrimeNumber: Codable, Hashable, RawRepresentable, Sendable {
18+
let rawValue: Int
19+
init?(rawValue: Int) {
2020
if !rawValue.isPrime { return nil }
2121
self.rawValue = rawValue
2222
}
2323

24-
public init(from decoder: any Decoder) throws {
24+
init(from decoder: any Decoder) throws {
2525
let container = try decoder.singleValueContainer()
2626
let number = try container.decode(Int.self)
2727
guard let value = Self(rawValue: number) else {
@@ -30,7 +30,7 @@ public struct CustomPrimeNumber: Codable, Hashable, RawRepresentable, Sendable {
3030
self = value
3131
}
3232

33-
public func encode(to encoder: any Encoder) throws {
33+
func encode(to encoder: any Encoder) throws {
3434
var container = encoder.singleValueContainer()
3535
try container.encode(self.rawValue)
3636
}

Sources/PetstoreConsumerTestCore/Common.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import OpenAPIRuntime
1515
import Foundation
1616
import HTTPTypes
1717

18+
/// An error used by Petstore tests.
1819
public enum TestError: Swift.Error, LocalizedError, CustomStringConvertible, Sendable {
1920
case noHandlerFound(method: HTTPRequest.Method, path: String)
2021
case invalidURLString(String)

0 commit comments

Comments
 (0)