diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index a46bd33730f3..9d565bf5993f 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false| |useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true| |useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: false).| |null| -|validatable|Make validation rules and validator for model properies (default: true)| |true| +|validatable|Make validation rules and validator for model properties (default: true)| |true| ## IMPORT MAPPING diff --git a/docs/generators/swift6.md b/docs/generators/swift6.md index b80a1d7996ab..a49865462eba 100644 --- a/docs/generators/swift6.md +++ b/docs/generators/swift6.md @@ -58,7 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false| |useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true| |useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: true).| |null| -|validatable|Make validation rules and validator for model properies (default: true)| |true| +|validatable|Make validation rules and validator for model properties (default: true)| |true| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 16ce68597cbb..b39fdf1e52b7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -84,25 +84,43 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig protected static final String RESPONSE_LIBRARY_COMBINE = "Combine"; protected static final String RESPONSE_LIBRARY_ASYNC_AWAIT = "AsyncAwait"; protected static final String[] RESPONSE_LIBRARIES = {RESPONSE_LIBRARY_PROMISE_KIT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_ASYNC_AWAIT}; - @Setter protected String projectName = "OpenAPIClient"; - @Setter protected boolean nonPublicApi = false; - @Setter protected boolean objcCompatible = false; - @Setter protected boolean readonlyProperties = false; - @Setter protected boolean swiftUseApiNamespace = false; - @Setter protected boolean useSPMFileStructure = false; - @Setter protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs"; - @Setter protected boolean oneOfUnknownDefaultCase = false; - @Setter protected boolean useClasses = false; - @Setter protected boolean useBacktickEscapes = false; - @Setter protected boolean generateModelAdditionalProperties = true; - @Setter protected boolean hashableModels = true; - @Setter protected boolean identifiableModels = true; - @Setter protected boolean useJsonEncodable = true; - @Getter @Setter + @Setter + protected String projectName = "OpenAPIClient"; + @Setter + protected boolean nonPublicApi = false; + @Setter + protected boolean objcCompatible = false; + @Setter + protected boolean readonlyProperties = false; + @Setter + protected boolean swiftUseApiNamespace = false; + @Setter + protected boolean useSPMFileStructure = false; + @Setter + protected String swiftPackagePath = "Classes" + File.separator + "OpenAPIs"; + @Setter + protected boolean oneOfUnknownDefaultCase = false; + @Setter + protected boolean useClasses = false; + @Setter + protected boolean useBacktickEscapes = false; + @Setter + protected boolean generateModelAdditionalProperties = true; + @Setter + protected boolean hashableModels = true; + @Setter + protected boolean identifiableModels = true; + @Setter + protected boolean useJsonEncodable = true; + @Getter + @Setter protected boolean mapFileBinaryToData = false; - @Setter protected boolean useCustomDateWithoutTime = false; - @Setter protected boolean validatable = true; - @Setter protected String[] responseAs = new String[0]; + @Setter + protected boolean useCustomDateWithoutTime = false; + @Setter + protected boolean validatable = true; + @Setter + protected String[] responseAs = new String[0]; protected String sourceFolder = swiftPackagePath; protected HashSet objcReservedWords; protected String apiDocPath = "docs/"; @@ -322,7 +340,7 @@ public Swift5ClientCodegen() { .defaultValue(Boolean.FALSE.toString())); cliOptions.add(new CliOption(VALIDATABLE, - "Make validation rules and validator for model properies (default: true)") + "Make validation rules and validator for model properties (default: true)") .defaultValue(Boolean.TRUE.toString())); supportedLibraries.put(LIBRARY_URLSESSION, "[DEFAULT] HTTP client: URLSession"); @@ -1189,7 +1207,7 @@ public void postProcessFile(File file, String fileType) { } // only process files with swift extension if ("swift".equals(FilenameUtils.getExtension(file.toString()))) { - this.executePostProcessor(new String[] {swiftPostProcessFile, file.toString()}); + this.executePostProcessor(new String[]{swiftPostProcessFile, file.toString()}); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java index 8c1bb2e0ffc7..5c665e8e3974 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java @@ -86,27 +86,48 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig protected static final String RESPONSE_LIBRARY_COMBINE = "Combine"; protected static final String RESPONSE_LIBRARY_ASYNC_AWAIT = "AsyncAwait"; protected static final String RESPONSE_LIBRARY_OBJC_BLOCK = "ObjcBlock"; - protected static final String[] RESPONSE_LIBRARIES = { RESPONSE_LIBRARY_ASYNC_AWAIT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_OBJC_BLOCK, RESPONSE_LIBRARY_PROMISE_KIT }; - @Setter protected String projectName = "OpenAPIClient"; - @Setter protected boolean nonPublicApi = false; - @Setter protected boolean objcCompatible = false; - @Setter protected boolean readonlyProperties = false; - @Setter protected boolean swiftUseApiNamespace = false; - @Setter protected boolean useSPMFileStructure = true; - @Setter protected String swiftPackagePath = "Sources" + File.separator + projectName; - @Setter protected boolean oneOfUnknownDefaultCase = false; - @Setter protected boolean useClasses = false; - @Setter protected boolean useBacktickEscapes = false; - @Setter protected boolean generateModelAdditionalProperties = true; - @Setter protected boolean hashableModels = true; - @Setter protected boolean identifiableModels = true; - @Setter protected boolean useJsonEncodable = true; - @Getter @Setter protected boolean mapFileBinaryToData = false; - @Setter protected boolean useCustomDateWithoutTime = false; - @Setter protected boolean validatable = true; - @Setter protected boolean apiStaticMethod = true; - @Setter protected boolean combineDeferred = true; - @Setter protected String[] responseAs = { RESPONSE_LIBRARY_ASYNC_AWAIT }; + protected static final String[] RESPONSE_LIBRARIES = {RESPONSE_LIBRARY_ASYNC_AWAIT, RESPONSE_LIBRARY_COMBINE, RESPONSE_LIBRARY_RESULT, RESPONSE_LIBRARY_RX_SWIFT, RESPONSE_LIBRARY_OBJC_BLOCK, RESPONSE_LIBRARY_PROMISE_KIT}; + @Setter + protected String projectName = "OpenAPIClient"; + @Setter + protected boolean nonPublicApi = false; + @Setter + protected boolean objcCompatible = false; + @Setter + protected boolean readonlyProperties = false; + @Setter + protected boolean swiftUseApiNamespace = false; + @Setter + protected boolean useSPMFileStructure = true; + @Setter + protected String swiftPackagePath = "Sources" + File.separator + projectName; + @Setter + protected boolean oneOfUnknownDefaultCase = false; + @Setter + protected boolean useClasses = false; + @Setter + protected boolean useBacktickEscapes = false; + @Setter + protected boolean generateModelAdditionalProperties = true; + @Setter + protected boolean hashableModels = true; + @Setter + protected boolean identifiableModels = true; + @Setter + protected boolean useJsonEncodable = true; + @Getter + @Setter + protected boolean mapFileBinaryToData = false; + @Setter + protected boolean useCustomDateWithoutTime = false; + @Setter + protected boolean validatable = true; + @Setter + protected boolean apiStaticMethod = true; + @Setter + protected boolean combineDeferred = true; + @Setter + protected String[] responseAs = {RESPONSE_LIBRARY_ASYNC_AWAIT}; protected String sourceFolder = swiftPackagePath; protected HashSet objcReservedWords; protected String apiDocPath = "docs/"; @@ -326,7 +347,7 @@ public Swift6ClientCodegen() { .defaultValue(Boolean.FALSE.toString())); cliOptions.add(new CliOption(VALIDATABLE, - "Make validation rules and validator for model properies (default: true)") + "Make validation rules and validator for model properties (default: true)") .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(API_STATIC_METHOD, @@ -1222,7 +1243,7 @@ public void postProcessFile(File file, String fileType) { } // only process files with swift extension if ("swift".equals(FilenameUtils.getExtension(file.toString()))) { - this.executePostProcessor(new String[] {swiftPostProcessFile, file.toString()}); + this.executePostProcessor(new String[]{swiftPostProcessFile, file.toString()}); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java index 95bd6c3b0bb7..0985f0c3364f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftCombineClientCodegen.java @@ -746,8 +746,8 @@ protected void addVendorExtensions(CodegenParameter cp, CodegenOperation operati CodegenModel baseModel = modelMaps.get(cp.items.dataType); boolean isBaseTypeEnum = cp.items.isEnum || cp.isEnum || (baseModel != null && baseModel.isEnum); cp.vendorExtensions.put("x-swift-is-base-type-enum", isBaseTypeEnum); - boolean isBaseTypeUdid = cp.items.isUuid || cp.isUuid; - cp.vendorExtensions.put("x-swift-is-base-type-udid", isBaseTypeUdid); + boolean isBaseTypeUuid = cp.items.isUuid || cp.isUuid; + cp.vendorExtensions.put("x-swift-is-base-type-uuid", isBaseTypeUuid); boolean useEncoder = !isBaseTypeEnum && !cp.items.isString || (baseModel != null && !baseModel.isString); cp.vendorExtensions.put("x-swift-use-encoder", useEncoder); diff --git a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache index db49e368692d..187ab989a8d9 100644 --- a/modules/openapi-generator/src/main/resources/swift-combine/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift-combine/api.mustache @@ -74,7 +74,7 @@ open class {{classname}} { /// - defaultResponse: {{.}}{{/defaultResponse}} {{#authMethods}} /// - {{#isBasicBasic}}BASIC{{/isBasicBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}: - /// - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}} + /// - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeader}}(HEADER){{/isKeyInHeader}}{{/keyParamName}} /// - name: {{name}} {{/authMethods}} {{#hasResponseHeaders}} @@ -212,4 +212,4 @@ open class {{classname}} { } {{/operation}} } -{{/operations}} \ No newline at end of file +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache b/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache index 5535cae98f1b..53ffae5b3b66 100644 --- a/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache +++ b/modules/openapi-generator/src/main/resources/swift-combine/toString.mustache @@ -1 +1 @@ -{{#isDateTime}}OpenISO8601DateFormatter.shared.string(from: {{paramName}}){{/isDateTime}}{{#vendorExtensions.x-swift-use-encoder}}String(data: try self.encoder.encode({{paramName}}), encoding: .utf8) ?? ""{{/vendorExtensions.x-swift-use-encoder}}{{^vendorExtensions.x-swift-use-encoder}}{{#isArray}}{{paramName}}{{#vendorExtensions.x-swift-is-base-type-udid}}.map { $0.uuidString }{{/vendorExtensions.x-swift-is-base-type-udid}}{{#vendorExtensions.x-swift-is-base-type-enum}}.map { $0.rawValue }{{/vendorExtensions.x-swift-is-base-type-enum}}.joined(separator: ","){{/isArray}}{{^isArray}}{{#vendorExtensions.x-swift-is-enum-type}}{{paramName}}.rawValue{{/vendorExtensions.x-swift-is-enum-type}}{{^isEnum}}{{#isString}}{{#isUuid}}{{paramName}}.uuidString{{/isUuid}}{{^isUuid}}{{paramName}}{{/isUuid}}{{/isString}}{{#isInteger}}"\({{paramName}})"{{/isInteger}}{{#isDouble}}"\({{paramName}})"{{/isDouble}}{{#isFloat}}"\({{paramName}})"{{/isFloat}}{{#isNumber}}"\({{paramName}})"{{/isNumber}}{{#isLong}}"\({{paramName}})"{{/isLong}}{{#isBoolean}}{{paramName}} ? "true" : "false"{{/isBoolean}}{{/isEnum}}{{/isArray}}{{/vendorExtensions.x-swift-use-encoder}} \ No newline at end of file +{{#isDateTime}}OpenISO8601DateFormatter.shared.string(from: {{paramName}}){{/isDateTime}}{{#vendorExtensions.x-swift-use-encoder}}String(data: try self.encoder.encode({{paramName}}), encoding: .utf8) ?? ""{{/vendorExtensions.x-swift-use-encoder}}{{^vendorExtensions.x-swift-use-encoder}}{{#isArray}}{{paramName}}{{#vendorExtensions.x-swift-is-base-type-uuid}}.map { $0.uuidString }{{/vendorExtensions.x-swift-is-base-type-uuid}}{{#vendorExtensions.x-swift-is-base-type-enum}}.map { $0.rawValue }{{/vendorExtensions.x-swift-is-base-type-enum}}.joined(separator: ","){{/isArray}}{{^isArray}}{{#vendorExtensions.x-swift-is-enum-type}}{{paramName}}.rawValue{{/vendorExtensions.x-swift-is-enum-type}}{{^isEnum}}{{#isString}}{{#isUuid}}{{paramName}}.uuidString{{/isUuid}}{{^isUuid}}{{paramName}}{{/isUuid}}{{/isString}}{{#isInteger}}"\({{paramName}})"{{/isInteger}}{{#isDouble}}"\({{paramName}})"{{/isDouble}}{{#isFloat}}"\({{paramName}})"{{/isFloat}}{{#isNumber}}"\({{paramName}})"{{/isNumber}}{{#isLong}}"\({{paramName}})"{{/isLong}}{{#isBoolean}}{{paramName}} ? "true" : "false"{{/isBoolean}}{{/isEnum}}{{/isArray}}{{/vendorExtensions.x-swift-use-encoder}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift5/Validation.mustache b/modules/openapi-generator/src/main/resources/swift5/Validation.mustache index 70e3abfb5057..91bbcf788555 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Validation.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Validation.mustache @@ -77,11 +77,11 @@ import Foundation /// - Throws: `ValidationError` if the numeric is invalid against the rule. {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ import Foundation /// - Throws: `ValidationError` if the numeric is invalid against the rule. {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/modules/openapi-generator/src/main/resources/swift6/Validation.mustache b/modules/openapi-generator/src/main/resources/swift6/Validation.mustache index 148a5123760d..2a2dab67d0c4 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Validation.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Validation.mustache @@ -78,11 +78,11 @@ extension NumericRule: Sendable where T: Sendable {} /// - Throws: `ValidationError` if the numeric is invalid against the rule. {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ extension NumericRule: Sendable where T: Sendable {} /// - Throws: `ValidationError` if the numeric is invalid against the rule. {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift index 94a82a25ec63..b299369a8996 100644 --- a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift +++ b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/PetAPI.swift @@ -273,7 +273,7 @@ open class PetAPI { /// - GET /pet/{petId} /// - Returns a single pet /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - parameter petId: (path) ID of pet to return /// - returns: AnyPublisher diff --git a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift index e0bd1eb56eb3..6277f998447b 100644 --- a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/StoreAPI.swift @@ -88,7 +88,7 @@ open class StoreAPI { /// - GET /store/inventory /// - Returns a map of status codes to quantities /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - returns: AnyPublisher<[String: Int], Error> open func getInventory() -> AnyPublisher<[String: Int], Error> { diff --git a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift index cd0e6b0611f3..071f6d3fdcf2 100644 --- a/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift +++ b/samples/client/petstore/swift-combine/client/PetstoreOpenAPI/Sources/APIs/UserAPI.swift @@ -32,7 +32,7 @@ open class UserAPI { /// - POST /user /// - This can only be done by the logged in user. /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - parameter user: (body) Created user object /// - returns: AnyPublisher @@ -68,7 +68,7 @@ open class UserAPI { /// - POST /user/createWithArray /// - /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - parameter user: (body) List of user object /// - returns: AnyPublisher @@ -104,7 +104,7 @@ open class UserAPI { /// - POST /user/createWithList /// - /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - parameter user: (body) List of user object /// - returns: AnyPublisher @@ -155,7 +155,7 @@ open class UserAPI { /// - DELETE /user/{username} /// - This can only be done by the logged in user. /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - parameter username: (path) The name that needs to be deleted /// - returns: AnyPublisher @@ -309,7 +309,7 @@ open class UserAPI { /// - GET /user/logout /// - /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - returns: AnyPublisher open func logoutUser() -> AnyPublisher { @@ -357,7 +357,7 @@ open class UserAPI { /// - PUT /user/{username} /// - This can only be done by the logged in user. /// - API Key: - /// - type: apiKey api_key + /// - type: apiKey api_key (HEADER) /// - name: api_key /// - parameter username: (path) name that need to be deleted /// - parameter user: (body) Updated user object diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index ced1069dd454..7591b5218353 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ internal struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. internal static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ internal struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. internal static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift +++ b/samples/client/petstore/swift5/validation/PetstoreClient/Classes/OpenAPIs/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift index 6a0d4c9da1ab..3bf4ec03fea4 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Validation.swift @@ -77,11 +77,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -109,11 +109,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index f9a3750d668f..104b74903650 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ internal struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. internal static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ internal struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. internal static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift index f2824965ddfb..d4c743d96074 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Infrastructure/Validation.swift @@ -78,11 +78,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } } @@ -110,11 +110,11 @@ public struct Validator { /// - Throws: `ValidationError` if the numeric is invalid against the rule. public static func validate(_ numeric: T, against rule: NumericRule) throws -> T { var error = ValidationError(kinds: []) - if let minium = rule.minimum { - if !rule.exclusiveMinimum, minium > numeric { + if let minimum = rule.minimum { + if !rule.exclusiveMinimum, minimum > numeric { error.kinds.insert(.minimum) } - if rule.exclusiveMinimum, minium >= numeric { + if rule.exclusiveMinimum, minimum >= numeric { error.kinds.insert(.minimum) } }