From ebbf5c6b7520c8bf90bb63cb1596cdf2f5623223 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Tue, 16 Sep 2025 10:46:27 +0200 Subject: [PATCH 1/2] Kick CI From 74a935467d17597286e093758c1b3f3f47efd43d Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Tue, 16 Sep 2025 10:56:48 +0200 Subject: [PATCH 2/2] Fix formatting --- .../Sources/TypeOverrides/CustomPrimeNumber.swift | 10 +++++----- Sources/PetstoreConsumerTestCore/Common.swift | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Examples/type-overrides-example/Sources/TypeOverrides/CustomPrimeNumber.swift b/Examples/type-overrides-example/Sources/TypeOverrides/CustomPrimeNumber.swift index 0f9514eeb..2cd5f2991 100644 --- a/Examples/type-overrides-example/Sources/TypeOverrides/CustomPrimeNumber.swift +++ b/Examples/type-overrides-example/Sources/TypeOverrides/CustomPrimeNumber.swift @@ -14,14 +14,14 @@ /// Example struct to be used instead of the default generated type. /// This illustrates how to introduce a type performing additional validation during Decoding that cannot be expressed with OpenAPI -public struct CustomPrimeNumber: Codable, Hashable, RawRepresentable, Sendable { - public let rawValue: Int - public init?(rawValue: Int) { +struct CustomPrimeNumber: Codable, Hashable, RawRepresentable, Sendable { + let rawValue: Int + init?(rawValue: Int) { if !rawValue.isPrime { return nil } self.rawValue = rawValue } - public init(from decoder: any Decoder) throws { + init(from decoder: any Decoder) throws { let container = try decoder.singleValueContainer() let number = try container.decode(Int.self) guard let value = Self(rawValue: number) else { @@ -30,7 +30,7 @@ public struct CustomPrimeNumber: Codable, Hashable, RawRepresentable, Sendable { self = value } - public func encode(to encoder: any Encoder) throws { + func encode(to encoder: any Encoder) throws { var container = encoder.singleValueContainer() try container.encode(self.rawValue) } diff --git a/Sources/PetstoreConsumerTestCore/Common.swift b/Sources/PetstoreConsumerTestCore/Common.swift index 828e140fa..9b53a8033 100644 --- a/Sources/PetstoreConsumerTestCore/Common.swift +++ b/Sources/PetstoreConsumerTestCore/Common.swift @@ -15,6 +15,7 @@ import OpenAPIRuntime import Foundation import HTTPTypes +/// An error used by Petstore tests. public enum TestError: Swift.Error, LocalizedError, CustomStringConvertible, Sendable { case noHandlerFound(method: HTTPRequest.Method, path: String) case invalidURLString(String)