diff --git a/bin/configs/swift5-default.yaml b/bin/configs/swift5-default.yaml index fffd318be1adff5fb0a9a187ef7565bf9c8d637c..0f905ed7e575668c2ef68339916c615091fce9e9 100644 --- a/bin/configs/swift5-default.yaml +++ b/bin/configs/swift5-default.yaml @@ -8,3 +8,4 @@ additionalProperties: podSummary: PetstoreClient projectName: PetstoreClient podHomepage: https://github.com/openapitools/openapi-generator + disallowAdditionalPropertiesIfNotPresent: false diff --git a/bin/configs/swift5-deprecated.yaml b/bin/configs/swift5-deprecated.yaml index 0b0206731342eedb28d90057649050c7b0391579..93aad93c61b503b7ec91020744a82dc2f5192c59 100644 --- a/bin/configs/swift5-deprecated.yaml +++ b/bin/configs/swift5-deprecated.yaml @@ -8,3 +8,4 @@ additionalProperties: podSummary: PetstoreClient projectName: PetstoreClient podHomepage: https://github.com/openapitools/openapi-generator + disallowAdditionalPropertiesIfNotPresent: false diff --git a/bin/configs/swift5-rxswiftLibrary.yaml b/bin/configs/swift5-rxswiftLibrary.yaml index 49d0e24cca5bd21c0e3252be50fbf2b8ad4b943b..ce9ff106f12aa904c4d02aec197c781c185e15c1 100644 --- a/bin/configs/swift5-rxswiftLibrary.yaml +++ b/bin/configs/swift5-rxswiftLibrary.yaml @@ -10,3 +10,4 @@ additionalProperties: projectName: PetstoreClient podHomepage: https://github.com/openapitools/openapi-generator useBacktickEscapes: true + disallowAdditionalPropertiesIfNotPresent: true 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 5d7f86a40d3097a1c5e9cbb77cfbf9938fec0cdd..6a8208b305efe7a9327150de7645d48727bc891f 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 @@ -274,6 +274,18 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig cliOptions.add(new CliOption(SWIFT_PACKAGE_PATH, "Set a custom source path instead of " + projectName + File.separator + "Classes" + File.separator + "OpenAPIs" + ".")); + CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean( + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, + CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.TRUE.toString()); + Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>(); + disallowAdditionalPropertiesIfNotPresentOpts.put("false", + "The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications."); + disallowAdditionalPropertiesIfNotPresentOpts.put("true", + "Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."); + disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts); + cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); + this.setDisallowAdditionalPropertiesIfNotPresent(false); + supportedLibraries.put(LIBRARY_URLSESSION, "[DEFAULT] HTTP client: URLSession"); supportedLibraries.put(LIBRARY_ALAMOFIRE, "HTTP client: Alamofire"); @@ -448,6 +460,11 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig setUseBacktickEscapes(convertPropertyToBooleanAndWriteBack(USE_BACKTICK_ESCAPES)); } + if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) { + this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); + } + setLenientTypeCast(convertPropertyToBooleanAndWriteBack(LENIENT_TYPE_CAST)); // make api and model doc path available in mustache template diff --git a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache index 7e6dcc1994f7bc45418dfb72bc6d182b0af79ddd..b7838998f5c9bd6c9755ab3cf27c0dda49803532 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Extensions.mustache @@ -8,6 +8,20 @@ import Foundation import AnyCodable{{#usePromiseKit}} import PromiseKit{{/usePromiseKit}} +{{#disallowAdditionalPropertiesIfNotPresent}} +disallowAdditionalPropertiesIfNotPresent +{{/disallowAdditionalPropertiesIfNotPresent}} +{{^disallowAdditionalPropertiesIfNotPresent}} +not disallowAdditionalPropertiesIfNotPresent +{{/disallowAdditionalPropertiesIfNotPresent}} + +{{#isAdditionalPropertiesTrue}} +isAdditionalPropertiesTrue +{{/isAdditionalPropertiesTrue}} +{{^isAdditionalPropertiesTrue}} +not isAdditionalPropertiesTrue +{{/isAdditionalPropertiesTrue}} + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -92,7 +106,7 @@ extension UUID: JSONEncodable { func encodeToJSON() -> Any { return self.uuidString } -} +}{{#isAdditionalPropertiesTrue}} extension String: CodingKey { @@ -178,7 +192,7 @@ extension KeyedDecodingContainerProtocol { return map } -} +}{{/isAdditionalPropertiesTrue}} extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache index c119f723a2a3a8e98febd526312b5bed49446a2a..049ffe6d04422d5cb43c3e5fd7795bf9dfab2112 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache @@ -36,12 +36,27 @@ {{/allVars}} } {{/hasVars}} + + {{#disallowAdditionalPropertiesIfNotPresent}} + disallowAdditionalPropertiesIfNotPresent + {{/disallowAdditionalPropertiesIfNotPresent}} + {{^disallowAdditionalPropertiesIfNotPresent}} + not disallowAdditionalPropertiesIfNotPresent + {{/disallowAdditionalPropertiesIfNotPresent}} + + {{#isAdditionalPropertiesTrue}} + isAdditionalPropertiesTrue + {{/isAdditionalPropertiesTrue}} + {{^isAdditionalPropertiesTrue}} + not isAdditionalPropertiesTrue + {{/isAdditionalPropertiesTrue}} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum CodingKeys: {{#hasVars}}String, {{/hasVars}}CodingKey, CaseIterable { {{#allVars}} case {{{name}}}{{#vendorExtensions.x-codegen-escaped-property-name}} = "{{{baseName}}}"{{/vendorExtensions.x-codegen-escaped-property-name}} {{/allVars}} - } -{{#additionalPropertiesType}} + }{{#isAdditionalPropertiesTrue}}{{#additionalPropertiesType}} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var additionalProperties: [String: {{{additionalPropertiesType}}}] = [:] {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} subscript(key: String) -> {{{additionalPropertiesType}}}? { @@ -55,8 +70,7 @@ set { additionalProperties[key] = newValue } - } -{{/additionalPropertiesType}} + }{{/additionalPropertiesType}}{{/isAdditionalPropertiesTrue}} // Encodable protocol methods @@ -65,13 +79,14 @@ {{#allVars}} try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: .{{{name}}}) {{/allVars}} + {{#isAdditionalPropertiesTrue}} {{#additionalPropertiesType}} var additionalPropertiesContainer = encoder.container(keyedBy: String.self) try additionalPropertiesContainer.encodeMap(additionalProperties) {{/additionalPropertiesType}} - } + {{/isAdditionalPropertiesTrue}} + }{{#isAdditionalPropertiesTrue}}{{#additionalPropertiesType}} -{{#additionalPropertiesType}} // Decodable protocol methods {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}}{{#objcCompatible}} required{{/objcCompatible}} init(from decoder: Decoder) throws { @@ -85,22 +100,19 @@ nonAdditionalPropertyKeys.insert("{{{baseName}}}") {{/allVars}} additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) - } -{{/additionalPropertiesType}} + }{{/additionalPropertiesType}}{{/isAdditionalPropertiesTrue}}{{^objcCompatible}}{{#useClasses}} -{{^objcCompatible}}{{#useClasses}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func == (lhs: {{classname}}, rhs: {{classname}}) -> Bool { {{#allVars}} lhs.{{{name}}} == rhs.{{{name}}}{{^-last}} &&{{/-last}} {{/allVars}} - {{#additionalPropertiesType}}{{#hasVars}}&& {{/hasVars}}lhs.additionalProperties == rhs.additionalProperties{{/additionalPropertiesType}} + {{#isAdditionalPropertiesTrue}}{{#additionalPropertiesType}}{{#hasVars}}&& {{/hasVars}}lhs.additionalProperties == rhs.additionalProperties{{/additionalPropertiesType}}{{/isAdditionalPropertiesTrue}} } {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func hash(into hasher: inout Hasher) { {{#allVars}} hasher.combine({{{name}}}{{^required}}?{{/required}}.hashValue) {{/allVars}} - {{#additionalPropertiesType}}hasher.combine(additionalProperties.hashValue){{/additionalPropertiesType}} - } -{{/useClasses}}{{/objcCompatible}} + {{#isAdditionalPropertiesTrue}}{{#additionalPropertiesType}}hasher.combine(additionalProperties.hashValue){{/additionalPropertiesType}}{{/isAdditionalPropertiesTrue}} + }{{/useClasses}}{{/objcCompatible}} } \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 75ab9bc8d0adabdeb2e443b43669f32bdc82aaee..63176377cdaee0005c9469dae77a5f6d657caa7b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 0f825cf24d0c1e70d982fbd99b6995890ec442ca..398772284161b8e94ce3b9d8b7b3eec2003e792a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 2b66af2dc949ca862a275887f1a1d6eb82b2ff3f..803c43c920e593203a3a85add8312de257165590 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 06f0640475c26f4717b68ee9e31b81a49d765556..41c59cba54535e04d06ee438832d5d9ddf8d10ff 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8c50c7fa1e441361129d2c551b453b091e166988..a39a7da55978a1f0bd7db455a52cacdd98fe3203 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 461ec7cd9acf5961a714d5428c03496341325ef9..d8d150d66e4d359ced217b336b14a3e7ebddab31 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index fbe62983d5e983b08dfd0462e244413588152b75..94c11eb16eee273aeaebccac0db30699e665d721 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7f3a86932f1bfa02db200e618dcc1f84e4133760..11c39f86b5e3596ec3d60a8a33ef849ac28d3bf7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8df2395483246aa7ab293e4fe69b5466e80e7037..abc185cb3e9baa54facb7de98d120a5fc6607647 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 4109db4d1ef7316a7e9364e1c49497d97025b759..b119bb2d038b62948b752c5168d53957ca9bf670 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 7269ddbef6fd8be4217ae0293c9c9a7ee0f26e56..714333fd252d00fda3df681b8e6ef91c71e2ca70 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7d6eff2ffe1f8aa332a1e759ee54660af8bd656c..ffb643506f7523089043c0f4c9f6f99a3c845139 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b5f2bcea38a3fd936be8023a8d99df660854bed7..89bb96b3072e6cd193b8804c715510f6413ef5b2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 1bfa23d7bc6da605cc293d5969c2742b77a972b8..475b1722fe3259937fb2600cd3b02755398e1c70 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 73368c421433628f53f301b5c2b3aea36d88f13c..6e366ded295155cef769c76d0af47e37c915dad0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60a81bcac77bb12fbd2a7cfe10d0bf7709112e8f..1dc381aa6292bb8b2420e407b5ba362114523fca 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 90283656d1b3cb8873259de6a3a2502fc5c92d34..41d7621d1de8310fbd64e254dd534bb1e62d8f7b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index cff92673bbeb9f3b35a9257feeb6b6b1a6fc0f8d..3f018160ba4533976046a9e2e55e487126e32c22 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index fc86676eec303e4d438c7a06adfea9db6bc2613e..1699dc0adb2614a750044671719ddb86594391b7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ public struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ public struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d7960f5c80086e8da4e2f15d7a2823c865cf79ec..f1e74efc334e4bacfc7a6d98ff5ee845d090c1f9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5d4f2cae5675edc8736951f1749b3827adb42f2..5afa9d18a252eb320a7158b94091da7cd190570b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b54bd01e5dc9a21d0d578ae7ee2cf6a249f3445a..06f176fdd2c56562c25db440b9c0dd4701cebd1a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c8f639ef43d06deeb90b16f07ce793909544b77f..c844117e6fc46b656f781807fab3e8e0644116a6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5368032f09b48d76879c7b931cb549eb73dadb2f..00eac7835c209cce0649246e6598d158dfc52a88 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 84a40e1c1016764dc3cc3f1bc48142b3baa1a483..c07bc4527177202697c50d1787c7a4e0abda3ee2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 710f41648f90f6848f686ba03285efd7a8ed1a23..84d57544d8e0806985bb211ac22414d1d2b2e468 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 15726ab16a47d1a802a0b61c69741117d1c3803e..01388e0780cf593be56f9d41d369cc467fdc47a4 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 36904afbd508e3f1fff2acf3aa1c7ecc58e0beb0..ead7911e296dbaee7a0664a00dd91bbef4a9f6e8 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7a1c2826a195f392fc6f4c8d5a7fb26bcaeafe4f..be697cb32e6329ef4bb9f235918a51efd8d46afb 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 38fb57af3287c19f93f0fd2a326b1debdb3780f4..3b767c9a18ece3c99e49234675f84e9714293db6 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index ed7e538a06d58e448fb26ebed167ba97e5a5f89e..6a78d9259a3551fb8d858c83aa2cf98732394e49 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 18747e071bc6d50707c4ed7b3f541d38f1551c50..381e57e9e78da8148b84f16f1126b3cef57f8bf0 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0699c25ff7ed19338239fdbcaa4f0e992df80e02..5a6129c74c49c9f7a4deb72617894b07e2aeb767 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 11c5f7a750bb27db7b14db43ee83eb2cfaf76dbe..23ea2753fed4ef076572399cf69b134eac30e916 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 35b1a5833b93ccedcf057f9832ea62281fff1e75..f35196b1b7fedbf7f4023f67df68b8ae93ea0786 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 37277a4ac00a0bf452d946357b50e7c6bd115484..1b35cb025d1c7562cd2852e08588fdd2945aaa9d 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 2bbc31806fff02ebb29f09b1da41181210664bdb..be60ede5da9a12889431191ff835f25209a8e076 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 75ab9bc8d0adabdeb2e443b43669f32bdc82aaee..63176377cdaee0005c9469dae77a5f6d657caa7b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 0f825cf24d0c1e70d982fbd99b6995890ec442ca..398772284161b8e94ce3b9d8b7b3eec2003e792a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 2b66af2dc949ca862a275887f1a1d6eb82b2ff3f..803c43c920e593203a3a85add8312de257165590 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 06f0640475c26f4717b68ee9e31b81a49d765556..41c59cba54535e04d06ee438832d5d9ddf8d10ff 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8c50c7fa1e441361129d2c551b453b091e166988..a39a7da55978a1f0bd7db455a52cacdd98fe3203 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 461ec7cd9acf5961a714d5428c03496341325ef9..d8d150d66e4d359ced217b336b14a3e7ebddab31 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index fbe62983d5e983b08dfd0462e244413588152b75..94c11eb16eee273aeaebccac0db30699e665d721 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7f3a86932f1bfa02db200e618dcc1f84e4133760..11c39f86b5e3596ec3d60a8a33ef849ac28d3bf7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8df2395483246aa7ab293e4fe69b5466e80e7037..abc185cb3e9baa54facb7de98d120a5fc6607647 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 4109db4d1ef7316a7e9364e1c49497d97025b759..b119bb2d038b62948b752c5168d53957ca9bf670 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 7269ddbef6fd8be4217ae0293c9c9a7ee0f26e56..714333fd252d00fda3df681b8e6ef91c71e2ca70 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7d6eff2ffe1f8aa332a1e759ee54660af8bd656c..ffb643506f7523089043c0f4c9f6f99a3c845139 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b5f2bcea38a3fd936be8023a8d99df660854bed7..89bb96b3072e6cd193b8804c715510f6413ef5b2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 1bfa23d7bc6da605cc293d5969c2742b77a972b8..475b1722fe3259937fb2600cd3b02755398e1c70 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 73368c421433628f53f301b5c2b3aea36d88f13c..6e366ded295155cef769c76d0af47e37c915dad0 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60a81bcac77bb12fbd2a7cfe10d0bf7709112e8f..1dc381aa6292bb8b2420e407b5ba362114523fca 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 90283656d1b3cb8873259de6a3a2502fc5c92d34..41d7621d1de8310fbd64e254dd534bb1e62d8f7b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index cff92673bbeb9f3b35a9257feeb6b6b1a6fc0f8d..3f018160ba4533976046a9e2e55e487126e32c22 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index fc86676eec303e4d438c7a06adfea9db6bc2613e..1699dc0adb2614a750044671719ddb86594391b7 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ public struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ public struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d7960f5c80086e8da4e2f15d7a2823c865cf79ec..f1e74efc334e4bacfc7a6d98ff5ee845d090c1f9 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5d4f2cae5675edc8736951f1749b3827adb42f2..5afa9d18a252eb320a7158b94091da7cd190570b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b54bd01e5dc9a21d0d578ae7ee2cf6a249f3445a..06f176fdd2c56562c25db440b9c0dd4701cebd1a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c8f639ef43d06deeb90b16f07ce793909544b77f..c844117e6fc46b656f781807fab3e8e0644116a6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5368032f09b48d76879c7b931cb549eb73dadb2f..00eac7835c209cce0649246e6598d158dfc52a88 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 84a40e1c1016764dc3cc3f1bc48142b3baa1a483..c07bc4527177202697c50d1787c7a4e0abda3ee2 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 710f41648f90f6848f686ba03285efd7a8ed1a23..84d57544d8e0806985bb211ac22414d1d2b2e468 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 15726ab16a47d1a802a0b61c69741117d1c3803e..01388e0780cf593be56f9d41d369cc467fdc47a4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 36904afbd508e3f1fff2acf3aa1c7ecc58e0beb0..ead7911e296dbaee7a0664a00dd91bbef4a9f6e8 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7a1c2826a195f392fc6f4c8d5a7fb26bcaeafe4f..be697cb32e6329ef4bb9f235918a51efd8d46afb 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 38fb57af3287c19f93f0fd2a326b1debdb3780f4..3b767c9a18ece3c99e49234675f84e9714293db6 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index ed7e538a06d58e448fb26ebed167ba97e5a5f89e..6a78d9259a3551fb8d858c83aa2cf98732394e49 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 18747e071bc6d50707c4ed7b3f541d38f1551c50..381e57e9e78da8148b84f16f1126b3cef57f8bf0 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0699c25ff7ed19338239fdbcaa4f0e992df80e02..5a6129c74c49c9f7a4deb72617894b07e2aeb767 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 11c5f7a750bb27db7b14db43ee83eb2cfaf76dbe..23ea2753fed4ef076572399cf69b134eac30e916 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 35b1a5833b93ccedcf057f9832ea62281fff1e75..f35196b1b7fedbf7f4023f67df68b8ae93ea0786 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 37277a4ac00a0bf452d946357b50e7c6bd115484..1b35cb025d1c7562cd2852e08588fdd2945aaa9d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 2bbc31806fff02ebb29f09b1da41181210664bdb..be60ede5da9a12889431191ff835f25209a8e076 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift index dd9fdef5c970883aaf4118b3292356517af0e9ec..2fef5a81e86e38eed6455d067fc868dda2de540d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesAnyType.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesAnyType: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: AnyCodable] = [:] - - public subscript(key: String) -> AnyCodable? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap(AnyCodable.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift index 03708059804ba4cc9483736e07f4b84275412bbc..8487f0adac7298ba0239b8088a3d703c7fcbf18c 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesArray.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesArray: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: [AnyCodable]] = [:] - - public subscript(key: String) -> [AnyCodable]? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap([AnyCodable].self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift index 6a8bd72e6e54c12879b4fc20a82802e0af1d4456..5570811752880bdb81cd00aa17bdf5be37c7000a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesBoolean.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesBoolean: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index abe4a18189062d52c790ef9f601801fded3df3d8..032d9b75866a8a77967d135b4d1d9d0589ebde84 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -35,6 +35,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.anytype2 = anytype2 self.anytype3 = anytype3 } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapNumber = "map_number" @@ -65,7 +70,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(anytype2, forKey: .anytype2) try container.encodeIfPresent(anytype3, forKey: .anytype3) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift index 90109260d0249c449b6dc7dd0868d236fe41fa9d..4ca117da59d6ef7716f5b73210872b56e90461f4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesInteger.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesInteger: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: Int] = [:] - - public subscript(key: String) -> Int? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift index 2cae455cf2485f3ac0175745bd58379db2388e29..db207a96fab9b3a7ee9ec8f2bb5ec85faa1283c9 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesNumber.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesNumber: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: Double] = [:] - - public subscript(key: String) -> Double? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap(Double.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift index 6f86abd07abbb703cd24fbd5ed6d8b80a397c622..af449f3e029969e697c94f13e45df4429fb6877b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesObject.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesObject: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: [String: AnyCodable]] = [:] - - public subscript(key: String) -> [String: AnyCodable]? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap([String: AnyCodable].self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift index b8b54f04b1b8057e65e765b9b27d07ab14a78ef1..2a819ab1be36be4bdbffeb43508e9f83e1769a80 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesString.swift @@ -15,43 +15,19 @@ public struct AdditionalPropertiesString: Codable, Hashable { public init(name: String? = nil) { self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name } - public var additionalProperties: [String: String] = [:] - - public subscript(key: String) -> String? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(name, forKey: .name) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - name = try container.decodeIfPresent(String.self, forKey: "name") - var nonAdditionalPropertyKeys = Set<String>() - nonAdditionalPropertyKeys.insert("name") - additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 0f825cf24d0c1e70d982fbd99b6995890ec442ca..398772284161b8e94ce3b9d8b7b3eec2003e792a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 2b66af2dc949ca862a275887f1a1d6eb82b2ff3f..803c43c920e593203a3a85add8312de257165590 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 06f0640475c26f4717b68ee9e31b81a49d765556..41c59cba54535e04d06ee438832d5d9ddf8d10ff 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8c50c7fa1e441361129d2c551b453b091e166988..a39a7da55978a1f0bd7db455a52cacdd98fe3203 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 461ec7cd9acf5961a714d5428c03496341325ef9..d8d150d66e4d359ced217b336b14a3e7ebddab31 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift index 9c3f0f237a3963d09dba04e9755059c9ce9603cd..6b06071c2b14d0b6b45669b71b2e709329ff2b61 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCat.swift @@ -21,6 +21,11 @@ public struct BigCat: Codable, Hashable { public init(kind: Kind? = nil) { self.kind = kind } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case kind } @@ -31,7 +36,4 @@ public struct BigCat: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(kind, forKey: .kind) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift index 6b78ab7b42a237e97351522b2aa2f7cdf5face0c..6cbd5c2514d5e526ac857d249adb5e91d06814d0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/BigCatAllOf.swift @@ -21,6 +21,11 @@ public struct BigCatAllOf: Codable, Hashable { public init(kind: Kind? = nil) { self.kind = kind } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case kind } @@ -31,7 +36,4 @@ public struct BigCatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(kind, forKey: .kind) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index fbe62983d5e983b08dfd0462e244413588152b75..94c11eb16eee273aeaebccac0db30699e665d721 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7f3a86932f1bfa02db200e618dcc1f84e4133760..11c39f86b5e3596ec3d60a8a33ef849ac28d3bf7 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8df2395483246aa7ab293e4fe69b5466e80e7037..abc185cb3e9baa54facb7de98d120a5fc6607647 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 611a8a32e39306c26f554e2480e19fc4c1f9ab87..bbac53aa316f77fc62d0107d86e591456bb80f45 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 7269ddbef6fd8be4217ae0293c9c9a7ee0f26e56..714333fd252d00fda3df681b8e6ef91c71e2ca70 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7d6eff2ffe1f8aa332a1e759ee54660af8bd656c..ffb643506f7523089043c0f4c9f6f99a3c845139 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b5f2bcea38a3fd936be8023a8d99df660854bed7..89bb96b3072e6cd193b8804c715510f6413ef5b2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 1bfa23d7bc6da605cc293d5969c2742b77a972b8..475b1722fe3259937fb2600cd3b02755398e1c70 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 73368c421433628f53f301b5c2b3aea36d88f13c..6e366ded295155cef769c76d0af47e37c915dad0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60a81bcac77bb12fbd2a7cfe10d0bf7709112e8f..1dc381aa6292bb8b2420e407b5ba362114523fca 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 90283656d1b3cb8873259de6a3a2502fc5c92d34..41d7621d1de8310fbd64e254dd534bb1e62d8f7b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index cff92673bbeb9f3b35a9257feeb6b6b1a6fc0f8d..3f018160ba4533976046a9e2e55e487126e32c22 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index ea348c3581ee46eaa3bb0fd87102a21077ad7da1..c5c8efb22b78f1d89228f3cac6c77f62d48f3943 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -41,6 +41,11 @@ public struct FormatTest: Codable, Hashable { self.password = password self.bigDecimal = bigDecimal } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -77,7 +82,4 @@ public struct FormatTest: Codable, Hashable { try container.encode(password, forKey: .password) try container.encodeIfPresent(bigDecimal, forKey: .bigDecimal) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d7960f5c80086e8da4e2f15d7a2823c865cf79ec..f1e74efc334e4bacfc7a6d98ff5ee845d090c1f9 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5d4f2cae5675edc8736951f1749b3827adb42f2..5afa9d18a252eb320a7158b94091da7cd190570b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b54bd01e5dc9a21d0d578ae7ee2cf6a249f3445a..06f176fdd2c56562c25db440b9c0dd4701cebd1a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c8f639ef43d06deeb90b16f07ce793909544b77f..c844117e6fc46b656f781807fab3e8e0644116a6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5368032f09b48d76879c7b931cb549eb73dadb2f..00eac7835c209cce0649246e6598d158dfc52a88 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 84a40e1c1016764dc3cc3f1bc48142b3baa1a483..c07bc4527177202697c50d1787c7a4e0abda3ee2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 710f41648f90f6848f686ba03285efd7a8ed1a23..84d57544d8e0806985bb211ac22414d1d2b2e468 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 15726ab16a47d1a802a0b61c69741117d1c3803e..01388e0780cf593be56f9d41d369cc467fdc47a4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 36904afbd508e3f1fff2acf3aa1c7ecc58e0beb0..ead7911e296dbaee7a0664a00dd91bbef4a9f6e8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 03e81af5d05b7b2651b65b6ab2254059b504fbab..7fcb2d73a3141c15173d326e33513ad09418113b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 38fb57af3287c19f93f0fd2a326b1debdb3780f4..3b767c9a18ece3c99e49234675f84e9714293db6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index ed7e538a06d58e448fb26ebed167ba97e5a5f89e..6a78d9259a3551fb8d858c83aa2cf98732394e49 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 18747e071bc6d50707c4ed7b3f541d38f1551c50..381e57e9e78da8148b84f16f1126b3cef57f8bf0 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0699c25ff7ed19338239fdbcaa4f0e992df80e02..5a6129c74c49c9f7a4deb72617894b07e2aeb767 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 11c5f7a750bb27db7b14db43ee83eb2cfaf76dbe..23ea2753fed4ef076572399cf69b134eac30e916 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 35b1a5833b93ccedcf057f9832ea62281fff1e75..f35196b1b7fedbf7f4023f67df68b8ae93ea0786 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 66dc3819f2a97a47a40881b444bd73377649e1a5..a5f305b95fda21cc3ed765f3339f4e74cc3b34b1 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -25,6 +25,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -45,7 +50,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 2bbc31806fff02ebb29f09b1da41181210664bdb..be60ede5da9a12889431191ff835f25209a8e076 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift index daa3716aeca617582266df6b38598d0d9bce9917..4d73fd5bfcd1fedca86b503d7826227b90a5becf 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/XmlItem.swift @@ -71,6 +71,11 @@ public struct XmlItem: Codable, Hashable { self.prefixNsArray = prefixNsArray self.prefixNsWrappedArray = prefixNsWrappedArray } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case attributeString = "attribute_string" case attributeNumber = "attribute_number" @@ -137,7 +142,4 @@ public struct XmlItem: Codable, Hashable { try container.encodeIfPresent(prefixNsArray, forKey: .prefixNsArray) try container.encodeIfPresent(prefixNsWrappedArray, forKey: .prefixNsWrappedArray) } - - - } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 8ed4cc03185b449c8bfd2c8c7ea8c1f5c3b258a1..58dd048300d197dd90a2fa4521f7547c333a309e 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -20,6 +20,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -34,7 +39,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 508c796f62694b337bfac9dfa2fe8a023ff18d51..81f88b940999555379f6737d1dd39daca2204b84 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -18,6 +18,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -30,7 +35,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 11ee45fef6902b2300f5bb43a32bace7df0cd97e..60b2e72442251c2e73ceee5078c94844f6596119 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -33,6 +33,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -53,7 +58,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index c1bac661e1fe52098ca662cd67b83ae2713ab337..a0c932b3ae36ca2fd5eb806e2e142866a0487a48 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -33,6 +33,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -53,7 +58,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 5a275f11b25caa54f54ed9e6961bfec8adc4f643..f3db5a6ceacc4fd68e353a6e15ff83adb84df2e4 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -18,6 +18,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -30,7 +35,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 058360d1249e407d71aca84fbc42316642b7afae..21fdeb5a6bbf18064a9aab9412454660d12272bf 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -31,6 +31,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -55,7 +60,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 729a612f7e60f1fbec3b332a687a60f7b836010f..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - internal mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - internal mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - internal mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - internal mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - internal func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - internal func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - internal func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 675937c90fa5502e88009e3a49b707455e1ad0f5..c06524c7d0675774b9e6a3aacee3f76a0f9c45c6 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ internal struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ internal struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 8c8ffe45faa847b83ad46e49aef1d1fb5441b7aa..47017913745da1951ae144f89d5e49ed25a14dae 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ internal struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ internal struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 25f5c34054ba603e7ad051fd017c6b877e66f486..b12120652a66c82197b0d91eb94860b8d6b1a203 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ internal struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ internal struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 48daaaffa2ff5121840a154678f93bade4c45452..aed0aecad88dc5fe0058a264864105210061ebe4 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ internal struct ArrayOfArrayOfNumberOnly: Codable, Hashable { internal init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ internal struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index b38ece08cc8b40a7c41df13e0ce6565bd7c79fd3..01dfc235b36540a8a4f001223612d6c0e22debb7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ internal struct ArrayOfNumberOnly: Codable, Hashable { internal init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ internal struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 60f642f72a9aa3905acbdc4b4973b8ec157f9843..d99210525c84f626a8f92fc48ceb3057ba9fb43d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ internal struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ internal struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 1184a9c9c780e4c050e65be05acf3647370007c8..9b553c5ded169f2652e7daaa3dfac35fe0f9c8ff 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ internal struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ internal struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 47016f63e3b3fe9fe565b19b4020324a8d693656..56839b2cb1db00d9fea9b7a0ca13b09325f209aa 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ internal struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ internal struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 9d01dbd63915c2460bf7cfcdb157cd2b5437ad51..e79fd66debf87d7b7a1b86cb39a8ff021c49ddc3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ internal struct CatAllOf: Codable, Hashable { internal init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ internal struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index b99e1f159fcbeb2d94801c37258748bedf55afd4..f0838721c0776ac381a36f9847d347083967fe91 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ internal struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ internal struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index efb0200fe3356674e58fa146924f9e203fb784bc..1d39afc47882fc250d677366acad54d2fb855cee 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ internal struct ClassModel: Codable, Hashable { internal init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ internal struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 84457478611bc31e8bb234b0a36dc8cf218e1a57..5b4e826a9aeb49f3835434955a0335e1231dac55 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ internal struct Client: Codable, Hashable { internal init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ internal struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 580fc9003c7a305a5835ace2880039a5ede39a63..98335af0de5f8e62b657ecbdad55b4d4bd6d06d9 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ internal struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ internal struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 33f2e3a8c1e1549d22640dceaa73a5bde40aeb60..fc7394389b4960e077e2055f2e510d612ca9c8b8 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ internal struct DogAllOf: Codable, Hashable { internal init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ internal struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 33a4472b1a7ce32a5da27b560c96224e07cacf88..70bab4c0f2f8fa4fe12cfb97de8e4fa5c79f4fed 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ internal struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ internal struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 476bf2dbbaa7327b4d19ba82246d582a5a0a1a26..b383b36daf9f7289978167805d25dc4c95bf6a48 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ internal struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ internal struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 668a27c089f0c9b71d3dc87b97b9d7beeb48c51a..e48123270da5002525cc3f715e48c9c0d4a8bfbe 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ internal struct File: Codable, Hashable { internal init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ internal struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 29e7ce62f3b6d11410cc305473dfd110b3b349bf..e3e89e7ab3180afabbbf98bdcce2a5c0d777d4aa 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ internal struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ internal struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index e42c76fb1b585be901f5431f498b5181c22ef40a..ec71b6f337664396ec972764ce5c0e682204f6d7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ internal struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ internal struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index fff4dc5bef6f6e91caae93f484200601151d4b34..9c612ed20b8021c529ca099df4e56c83c03d05a8 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ internal struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ internal struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 71249ab1f5c88bff5383b9655be2ade0d3c522e5..faab9ceb9dd86f1fedbe4085286952c4ae154c9c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ internal struct List: Codable, Hashable { internal init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ internal struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index c1057f3ebf57af01adad195fc36b2c9f2a0dd1a5..3b0cd5d16309ef60214ed810bb2cf9a704a39afa 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ internal struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ internal struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index ebf6ae145dd0fbf9fccfe0766a8c6b9ff8029348..48cc92a1464575e4403be7badac6674a564814e7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 1efae876cbfaa69245a69bd42406c0e9d975c8b0..9449b78874fdc2102ea12fe120c2fe42e35b5bf8 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ internal struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ internal struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index aa9337dedc434151b1452512933adaf07ef89a49..782366d168d97d5654a6c6fab50e5f18ca7ef446 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ internal struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ internal struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 0748cf0a096d90b552a0f0abad2616425d8a83d6..c752b2ddc467b843d163dc8be90c54dc4219dc47 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ internal struct NumberOnly: Codable, Hashable { internal init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ internal struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 378e41056a87d3059c13448deffcc16730d24458..c1bfbab4cb767c0a1778ce0e868ca5515621c916 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ internal struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ internal struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 76508a79a262aded46f8fb4b15507b099cc30602..0a2379602c5437552fa33288a6084a2a2884c13f 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ internal struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ internal struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index c28c280608f7fae87acc9b8a3733976e824c310e..d32dd05c30f553c4cf123b3eba1442fff0f1149d 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ internal struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ internal struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 7f9cf4abd2e3d946e6a07570c466adf01dcab329..66a5177f34969af272811a7f82f92f4e98e98d98 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ internal struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ internal struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index bd512e38ac3f330a59032ad77ec5012d13d51d2b..87f60792673914aff0dc4753d39eff73a25887df 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ internal struct Return: Codable, Hashable { internal init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ internal struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 848bbe6f38441e34e78e2cfc246776e3bed407a8..c55a86a1559828a5d79ac201319c69821fa62cda 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ internal struct SpecialModelName: Codable, Hashable { internal init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ internal struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 50ff6bedf9b7a5df7b37dd1a754bab1ad0d241d5..df4fa349f5f5784612dcb8dc0bc7689038e957a4 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable internal struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + internal enum CodingKeys: CodingKey, CaseIterable { } - internal var additionalProperties: [String: Bool] = [:] - - internal subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods internal func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - internal init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 2acf7c82cd489b6a1c1c4e022a17ef60e1036b27..a26204f71245b2ae038ee1994f01c9e1f7954cbd 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ internal struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ internal struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 1e306e356999b3d2b45c3f4656e7c0c8bb130c73..f82b685a2da188760e41c13be4592bd40b7253ac 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ internal struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ internal struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 386054d5ca96814dfab83b947e6dfa5a68f72ead..3ace835ba2e654f5be1379ba3da301e6d40568f4 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ internal struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ internal struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift index a3e131ac3d92d9fe1585ae8398e44e6bbf87ab5a..a942935ba6a4c014e61eb7af0541f04d54297634 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ internal struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + internal enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ internal struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index aab3e933f3fa0b0f78e61cb57d4f332fccb4960a..f1e388f175134df19af5faa167c66287c8b0375c 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ import AnyCodable self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ import AnyCodable try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index edd4017fd47f243d1aca3188f25366eb5d05aefc..724f1486a90ab8823b46c83ff89d5ce4b7d895d2 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ import AnyCodable self._className = _className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color @@ -29,7 +34,4 @@ import AnyCodable try container.encode(_className, forKey: ._className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 7c6f40923fa0f87299bc48162d01859833037bf2..a5cd8ed237164563609d010e263ae3ec89812040 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -24,6 +24,11 @@ import AnyCodable self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -38,7 +43,4 @@ import AnyCodable try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 1971654130e03d5573b0fb6e008f7085aa90a684..aff24dc00993296428d85c5441dc84a4942f8071 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ import AnyCodable public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 5802e520a2ae9c748a05409073d0e0d7de41b382..31cf27947608ad009a92c2f2c0ecb26c58e304fc 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ import AnyCodable public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 1f33262b749442f1a578c8096ece5d8263fe0be6..00badfbae78fe48263ae947ddc65a3fa289aa410 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ import AnyCodable self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ import AnyCodable try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 0ede392b725c3dda32b9d84d0784b762384b126b..75ea2c6b37c277e1bf9c60b9aa14f259b9dc9449 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ import AnyCodable self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ import AnyCodable try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index ac482af78678a87b6363557effc1f80fd11c3953..dba5e8b98ff58c8d8c1a4c1e3b99f495fde4f535 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -24,6 +24,11 @@ import AnyCodable self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color @@ -38,7 +43,4 @@ import AnyCodable try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 714af722413e2b89f50e29c363389859936fed96..bb40f2f886403ab3f1c9822226e0edd7b866f7fc 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -20,6 +20,11 @@ import AnyCodable public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -30,7 +35,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 4545308c0b57045c2cc6898159fff971adbda2b0..907d47ee23939c827f125592625c6d58105f7445 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -22,6 +22,11 @@ import AnyCodable self._id = _id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name @@ -34,7 +39,4 @@ import AnyCodable try container.encodeIfPresent(_id, forKey: ._id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index a16525261cd02fc00785f0ae9487c4ff8b570a6a..2e390af0281baae67efa9f5ba6d6e1a82592a969 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ import AnyCodable public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 1a3e53ef2f3ab828ce621055ab305b33fa9e4dbc..4b83b7734af515935d2031eebc8e52b97f0cd58a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ import AnyCodable public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b6de22c59402351ec9ddb82c08b34dcca4c94673..0e678fb3ff010deab870f86fdb69dfdf75506095 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ import AnyCodable self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _className = "className" case color @@ -33,7 +38,4 @@ import AnyCodable try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 88215365c681feb4bb3edbe09b1793924f6e534c..e75b91da405634e4a8c1c1f2a3c566729689fbcf 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ import AnyCodable public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index c3f1766d81c8988d7088301ef6d38e9e42cefd49..1d88bd50d79576b5e5407b9fccef1cb431159075 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ import AnyCodable self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ import AnyCodable try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index ac8620deb3ba22f6061391c6f4132f1964140b7a..bfabfdc93d26d87a9f62a8a849eb7e758543f8fa 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ import AnyCodable self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ import AnyCodable try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 0fac5200c96ecb08fafd4e6fba744dfe71f80a98..b4cf7236e6e1106da325962e70959c854d189c47 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ import AnyCodable public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 062b68c5e5a392b220bc1d1ae03cba9228b38734..6f0a0bfd841fb3533b1c5b8bc16339a8ab113797 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ import AnyCodable self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ import AnyCodable try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index dacf0f0fc21b3ced97790b1dfea65cc5cbbeeecf..7e95eb205bf4b880f60f02a9ec931d87c2ecc6f5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -64,6 +64,11 @@ import AnyCodable self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -98,7 +103,4 @@ import AnyCodable try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index ac9b61b5a15db1bb60d8dab7a137315adbc45517..0668ae054702cc014566bd14e8b047e0dc3acb45 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ import AnyCodable self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ import AnyCodable try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift index cfb6cbbe8d5f9adfc12ab6a5712bd298ca2b03c9..4b6566df38b63568cf46422555413a54ad92b00d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ import AnyCodable public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 17011781e79df77da365733b19e54cc1fe16a750..9bf2cbbe0344363530f1b9b7f9949a827b0de265 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ import AnyCodable self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ import AnyCodable try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index ee69cad2f18fe2880cb20545af34ad5a9ff0c398..e4e1376115d8cc6e00776a60c7e7db72b17bd6ae 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ import AnyCodable self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ import AnyCodable try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 19617eb563ef11723ba68b01a6b9a13d673efd0b..2bb7ef82b00c94dd6f6e4ab43ec17d3c5afe3508 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -23,6 +23,11 @@ import AnyCodable self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -35,7 +40,4 @@ import AnyCodable try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 50b14e9343a6e0dde9b8ee07e4bcbfcf636f6482..88c73a58fdce882633597249940db88d5d2ba7d5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -32,6 +32,11 @@ import AnyCodable self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -48,7 +53,4 @@ import AnyCodable try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 6da3b7f3634d921c9a508de79237f9d62f4fbf56..3586d2551a8cb57df56c818484b60cd2f368037a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ import AnyCodable public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index ad21080d02411b2c77d1abce2f1e0a75c10a1f04..bfadadbbe95d3499ba45afcdf7522cd83eb4fc1b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -51,6 +51,11 @@ import AnyCodable self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case petId @@ -71,7 +76,4 @@ import AnyCodable try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index ad7118aae8b3e140910216977b5c18b924c2eb8a..d2ce66fa6178fb368876a66909eeeece3ccbd362 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -24,6 +24,11 @@ import AnyCodable self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -38,7 +43,4 @@ import AnyCodable try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index dcd875c089870806f2ded19c8b8d9e2ee3994b78..5d441f50cb8918d66804c41911a092154cece8b6 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -36,6 +36,11 @@ import AnyCodable self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case category @@ -56,7 +61,4 @@ import AnyCodable try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 1b278c72d119e775816703d5431a00ed8a8294dc..e312faa9387171afcebd80243a8624dcaa7023f5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ import AnyCodable self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ import AnyCodable try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index f5c4e90d0e1e55ed4f22f4c2695878517d006c24..f92d1ead12c30a7e8d9888e0a09f774ab3c08997 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -21,6 +21,11 @@ import AnyCodable public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -31,7 +36,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index a512f5fb327835020ec2b0711638c7fbb80385d6..b4798e4ca4f365637f19fe4770d43c239c1b29d5 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -20,6 +20,11 @@ import AnyCodable public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -30,7 +35,4 @@ import AnyCodable var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 1cb86591c3c28faf64503c7d551acfed4621fe23..f0abc43033455ddcf4789287326ccc70ab5f4c2f 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable @objc public class StringBooleanMap: NSObject, Codable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public required init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index eea33c371aca8e24bd656da696fc20dfc3b98cd6..409a23992d32d182ac8be75e5fdba7a7f6908520 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -22,6 +22,11 @@ import AnyCodable self._id = _id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case name @@ -34,7 +39,4 @@ import AnyCodable try container.encodeIfPresent(_id, forKey: ._id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index b6c174ed146120e83177bb056f095b1eca1ce624..6902967aa50f812b7114870181d73bd594bb6657 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ import AnyCodable self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ import AnyCodable try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index d794fec5ce9dbf6ad6de6bd83fad2721df50daf3..bcb9747b9972f2ca75c2024f923cb8e5077ce37d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ import AnyCodable self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ import AnyCodable try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f233f6cccbdf9581bc6530c06cf5401567445039..5bc9105bc6d465a8b2a9c1755d6689e49709ae80 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -40,6 +40,11 @@ import AnyCodable self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _id = "id" case username @@ -64,7 +69,4 @@ import AnyCodable try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 78d15ab2990d3ea46ef492df3ae10ad2ff9b2369..daca8ca85bf4680af74696c9b6a78488ed37500d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -8,6 +8,10 @@ import Foundation import AnyCodable import PromiseKit +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -94,92 +98,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 75ab9bc8d0adabdeb2e443b43669f32bdc82aaee..63176377cdaee0005c9469dae77a5f6d657caa7b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 0f825cf24d0c1e70d982fbd99b6995890ec442ca..398772284161b8e94ce3b9d8b7b3eec2003e792a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 2b66af2dc949ca862a275887f1a1d6eb82b2ff3f..803c43c920e593203a3a85add8312de257165590 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 06f0640475c26f4717b68ee9e31b81a49d765556..41c59cba54535e04d06ee438832d5d9ddf8d10ff 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8c50c7fa1e441361129d2c551b453b091e166988..a39a7da55978a1f0bd7db455a52cacdd98fe3203 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 461ec7cd9acf5961a714d5428c03496341325ef9..d8d150d66e4d359ced217b336b14a3e7ebddab31 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index fbe62983d5e983b08dfd0462e244413588152b75..94c11eb16eee273aeaebccac0db30699e665d721 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7f3a86932f1bfa02db200e618dcc1f84e4133760..11c39f86b5e3596ec3d60a8a33ef849ac28d3bf7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8df2395483246aa7ab293e4fe69b5466e80e7037..abc185cb3e9baa54facb7de98d120a5fc6607647 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 4109db4d1ef7316a7e9364e1c49497d97025b759..b119bb2d038b62948b752c5168d53957ca9bf670 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 7269ddbef6fd8be4217ae0293c9c9a7ee0f26e56..714333fd252d00fda3df681b8e6ef91c71e2ca70 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7d6eff2ffe1f8aa332a1e759ee54660af8bd656c..ffb643506f7523089043c0f4c9f6f99a3c845139 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b5f2bcea38a3fd936be8023a8d99df660854bed7..89bb96b3072e6cd193b8804c715510f6413ef5b2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 1bfa23d7bc6da605cc293d5969c2742b77a972b8..475b1722fe3259937fb2600cd3b02755398e1c70 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 73368c421433628f53f301b5c2b3aea36d88f13c..6e366ded295155cef769c76d0af47e37c915dad0 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60a81bcac77bb12fbd2a7cfe10d0bf7709112e8f..1dc381aa6292bb8b2420e407b5ba362114523fca 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 90283656d1b3cb8873259de6a3a2502fc5c92d34..41d7621d1de8310fbd64e254dd534bb1e62d8f7b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index cff92673bbeb9f3b35a9257feeb6b6b1a6fc0f8d..3f018160ba4533976046a9e2e55e487126e32c22 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index fc86676eec303e4d438c7a06adfea9db6bc2613e..1699dc0adb2614a750044671719ddb86594391b7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ public struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ public struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d7960f5c80086e8da4e2f15d7a2823c865cf79ec..f1e74efc334e4bacfc7a6d98ff5ee845d090c1f9 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5d4f2cae5675edc8736951f1749b3827adb42f2..5afa9d18a252eb320a7158b94091da7cd190570b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b54bd01e5dc9a21d0d578ae7ee2cf6a249f3445a..06f176fdd2c56562c25db440b9c0dd4701cebd1a 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c8f639ef43d06deeb90b16f07ce793909544b77f..c844117e6fc46b656f781807fab3e8e0644116a6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5368032f09b48d76879c7b931cb549eb73dadb2f..00eac7835c209cce0649246e6598d158dfc52a88 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 84a40e1c1016764dc3cc3f1bc48142b3baa1a483..c07bc4527177202697c50d1787c7a4e0abda3ee2 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 710f41648f90f6848f686ba03285efd7a8ed1a23..84d57544d8e0806985bb211ac22414d1d2b2e468 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 15726ab16a47d1a802a0b61c69741117d1c3803e..01388e0780cf593be56f9d41d369cc467fdc47a4 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 36904afbd508e3f1fff2acf3aa1c7ecc58e0beb0..ead7911e296dbaee7a0664a00dd91bbef4a9f6e8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7a1c2826a195f392fc6f4c8d5a7fb26bcaeafe4f..be697cb32e6329ef4bb9f235918a51efd8d46afb 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 38fb57af3287c19f93f0fd2a326b1debdb3780f4..3b767c9a18ece3c99e49234675f84e9714293db6 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index ed7e538a06d58e448fb26ebed167ba97e5a5f89e..6a78d9259a3551fb8d858c83aa2cf98732394e49 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 18747e071bc6d50707c4ed7b3f541d38f1551c50..381e57e9e78da8148b84f16f1126b3cef57f8bf0 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0699c25ff7ed19338239fdbcaa4f0e992df80e02..5a6129c74c49c9f7a4deb72617894b07e2aeb767 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 11c5f7a750bb27db7b14db43ee83eb2cfaf76dbe..23ea2753fed4ef076572399cf69b134eac30e916 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 35b1a5833b93ccedcf057f9832ea62281fff1e75..f35196b1b7fedbf7f4023f67df68b8ae93ea0786 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 37277a4ac00a0bf452d946357b50e7c6bd115484..1b35cb025d1c7562cd2852e08588fdd2945aaa9d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 2bbc31806fff02ebb29f09b1da41181210664bdb..be60ede5da9a12889431191ff835f25209a8e076 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index ccdd14f3260831471c3e0f298e012a7ef3d00bf0..fb356c11f1503edb4199dcd399c137a55a0f2952 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 4efa18dd3164a632c2826c78941aacd061fd68d3..1fa5af73af6f4b361e4266a85ad9df53283d6c85 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 72f8703b0f82843deb9872ff039ea873a36a20fc..bf57a74275c3e4187a96f018f35b322c8ae181d0 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 0904c46933234d4dab80755545b016356d4c6601..765fb46abc74165d39f08922bd4d596ce0b4625c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index e91f2a29097a0c9704247cbfba73f28e3eeab878..8daf0da8a208a67f320ee56a2dbbb53a8314aadc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 5262ce6185fa437b009be5f1ba44f465d097e940..f7dc4eb1fde2f95837e9ef54c06c88ae73cdab5e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 63f53d282930f8968dd7858b90e9b6a1e88b0c9d..1513739dc45bf0055d956b53ce519bc171bba8f7 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index a74ed96c8ccbcd88a7de33caa5b4006f12f1cd03..5451800357e0cb65abb77d287f24d330726c3717 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index d6ef582ff640a6ab06e64fa7999bed75ff7569f2..8538c19eaf5d134499e9a3cb9e10066922e74310 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 27c46ebc1ce05519ddb7b64850e522ad281784a4..a782fa0dc3f338cba0579280863d85256132c89c 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index e5e78f49084d18f6760f5c6eb30caf339c2f53cf..005ec63008b97199b02b31990a36fbcb474fe30d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7553011dbf3f92e8be7ef3a835b34fbadbe09736..12f68e2ba118206f36f0cdf6a68d57243ac654e5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index c458bc06ab03c11da575afe7994b56e812658502..98d7b7721bd09a025575661a7210c2612c1adfef 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 6e165285668b4fe02650f34e8d56bef56f4b6e8a..9895a2d480b2f57f60cb64302adca343637828dd 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 4850d7bbe5a0cf347d8037f62206a9a59d651896..f58008d39b1eb2eef01a603fc37f5ea64e92d16d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index ec8c5ff72bc0b0d3d69e80d565d89b6f383616fd..01d799eedf02e6905a07af65994815ac3974d6dc 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift index bfe11105fc61394eb003cf823f455145435adef0..e7b9186fd17f0eafcdd9d757941b499ec50bb7d8 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index dd837236657b06fe9abf14b75451296544c3f182..fc9180885ec0e94f014f98df1335d23bae33f8b0 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 078c2c4a08c5fef40f676c2d9f8404ad3125ff3c..ff4a773c71fa8c25407dfe660a4ecc563aa4f0d5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ public struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ public struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index cddd61da5f76ad4093dc1658cb0e2961c5cd3570..baceacf8277f0a201112c33f7ff8c365069cf464 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift index b03a8bd8cfdc9ffccb34a65654c1892e715cd2c7..d7ad28da2c99e4e6b9df44e1d7d789f0d1644892 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index db5928bc97e5c6239f423736c7e06d8f068859e7..f8176bcc266c7c67bb5a0eabdd7ca1104cbb97bf 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index cd1c8eb22c05d870667593d3044fabbbcfdece3f..a053bf4b5ec801f17d32f490386a66a3b049ec86 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 070ed68254b2d1cfd4279c7d0af63429d5465e98..51ff54b6149a4be436ffc61947758dcca9802c95 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index c90f8deb5563c28faf47f9987189ba5604ea4d17..50c862628dd9c4259a50dc2edbd45dc69cebf6f5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 32a62548302a08c52db08c0ba651d97ae9b38919..66b857f91cc48d20bf2f1dfd4abba777b641e727 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index cf5160c930db53c03eda024749d0aae9759532fb..9bee62fe7aeee766b1df99a3fc4c2cf1412c3f01 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 72a76adba292abacb9766f75f768a113c9f746dc..6453d57385de74aa77e8acb7b1a82a59ad7242f0 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index d47534027595912420f1fa930bd88a4b6c707a6e..afaf87d6a9c7f9c490e67861c0353346a8e820ad 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 6f285eef8a0e8d1eb0a32ed4100c48c7806258c4..b5f6544a02190e429d5e2e2d58eefb984c64878e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 2c791780b410b686e58db980deae2e262071564f..e3b731338e91ca34c6da13f19b87061bd1b34b57 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index baf14720175682cb54d378f47d3ae90c350be5bb..184a23d6e73102f71a333ffb414cc1434f70eada 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0b671fe0ad3bea1de2b7a10b12c37e03fbfa1a08..5a6129c74c49c9f7a4deb72617894b07e2aeb767 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public private(set) var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 76fdd4a783dd98df234205c3cdaceedaa98f12ae..3701bbe53d6d55dd1cdf35247a2461b670c5b5d1 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index d518a528ba70d1a61af47cd8c5bd38c2b41f2c9f..633d1b5e5fdeddde2d7f975b4fbf8e77ca2c52a2 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 07ec715e38a075792fc3ecb6ec5a9a463f1dd23f..c5b287e538deb0ec537d195877f62e6e097c17f3 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift index f9a7b1e36e3eb853cecb48ca3a543829bac9a3d3..3dbebc2dc27f43fcb44da2d5af032d238bbae5be 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 75ab9bc8d0adabdeb2e443b43669f32bdc82aaee..63176377cdaee0005c9469dae77a5f6d657caa7b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 0f825cf24d0c1e70d982fbd99b6995890ec442ca..398772284161b8e94ce3b9d8b7b3eec2003e792a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 2b66af2dc949ca862a275887f1a1d6eb82b2ff3f..803c43c920e593203a3a85add8312de257165590 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 06f0640475c26f4717b68ee9e31b81a49d765556..41c59cba54535e04d06ee438832d5d9ddf8d10ff 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8c50c7fa1e441361129d2c551b453b091e166988..a39a7da55978a1f0bd7db455a52cacdd98fe3203 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 461ec7cd9acf5961a714d5428c03496341325ef9..d8d150d66e4d359ced217b336b14a3e7ebddab31 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index fbe62983d5e983b08dfd0462e244413588152b75..94c11eb16eee273aeaebccac0db30699e665d721 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7f3a86932f1bfa02db200e618dcc1f84e4133760..11c39f86b5e3596ec3d60a8a33ef849ac28d3bf7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8df2395483246aa7ab293e4fe69b5466e80e7037..abc185cb3e9baa54facb7de98d120a5fc6607647 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 4109db4d1ef7316a7e9364e1c49497d97025b759..b119bb2d038b62948b752c5168d53957ca9bf670 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 7269ddbef6fd8be4217ae0293c9c9a7ee0f26e56..714333fd252d00fda3df681b8e6ef91c71e2ca70 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7d6eff2ffe1f8aa332a1e759ee54660af8bd656c..ffb643506f7523089043c0f4c9f6f99a3c845139 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b5f2bcea38a3fd936be8023a8d99df660854bed7..89bb96b3072e6cd193b8804c715510f6413ef5b2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 1bfa23d7bc6da605cc293d5969c2742b77a972b8..475b1722fe3259937fb2600cd3b02755398e1c70 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 73368c421433628f53f301b5c2b3aea36d88f13c..6e366ded295155cef769c76d0af47e37c915dad0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60a81bcac77bb12fbd2a7cfe10d0bf7709112e8f..1dc381aa6292bb8b2420e407b5ba362114523fca 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 90283656d1b3cb8873259de6a3a2502fc5c92d34..41d7621d1de8310fbd64e254dd534bb1e62d8f7b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index cff92673bbeb9f3b35a9257feeb6b6b1a6fc0f8d..3f018160ba4533976046a9e2e55e487126e32c22 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index fc86676eec303e4d438c7a06adfea9db6bc2613e..1699dc0adb2614a750044671719ddb86594391b7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ public struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ public struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d7960f5c80086e8da4e2f15d7a2823c865cf79ec..f1e74efc334e4bacfc7a6d98ff5ee845d090c1f9 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5d4f2cae5675edc8736951f1749b3827adb42f2..5afa9d18a252eb320a7158b94091da7cd190570b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b54bd01e5dc9a21d0d578ae7ee2cf6a249f3445a..06f176fdd2c56562c25db440b9c0dd4701cebd1a 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c8f639ef43d06deeb90b16f07ce793909544b77f..c844117e6fc46b656f781807fab3e8e0644116a6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 5368032f09b48d76879c7b931cb549eb73dadb2f..00eac7835c209cce0649246e6598d158dfc52a88 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(_class, forKey: ._class) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 84a40e1c1016764dc3cc3f1bc48142b3baa1a483..c07bc4527177202697c50d1787c7a4e0abda3ee2 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 710f41648f90f6848f686ba03285efd7a8ed1a23..84d57544d8e0806985bb211ac22414d1d2b2e468 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 15726ab16a47d1a802a0b61c69741117d1c3803e..01388e0780cf593be56f9d41d369cc467fdc47a4 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 36904afbd508e3f1fff2acf3aa1c7ecc58e0beb0..ead7911e296dbaee7a0664a00dd91bbef4a9f6e8 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7a1c2826a195f392fc6f4c8d5a7fb26bcaeafe4f..be697cb32e6329ef4bb9f235918a51efd8d46afb 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 38fb57af3287c19f93f0fd2a326b1debdb3780f4..3b767c9a18ece3c99e49234675f84e9714293db6 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index ed7e538a06d58e448fb26ebed167ba97e5a5f89e..6a78d9259a3551fb8d858c83aa2cf98732394e49 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_return, forKey: ._return) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 18747e071bc6d50707c4ed7b3f541d38f1551c50..381e57e9e78da8148b84f16f1126b3cef57f8bf0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0699c25ff7ed19338239fdbcaa4f0e992df80e02..5a6129c74c49c9f7a4deb72617894b07e2aeb767 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 11c5f7a750bb27db7b14db43ee83eb2cfaf76dbe..23ea2753fed4ef076572399cf69b134eac30e916 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 35b1a5833b93ccedcf057f9832ea62281fff1e75..f35196b1b7fedbf7f4023f67df68b8ae93ea0786 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 37277a4ac00a0bf452d946357b50e7c6bd115484..1b35cb025d1c7562cd2852e08588fdd2945aaa9d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 2bbc31806fff02ebb29f09b1da41181210664bdb..be60ede5da9a12889431191ff835f25209a8e076 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..884576af103a320eb39e04f022e3442296817a6f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 75ab9bc8d0adabdeb2e443b43669f32bdc82aaee..17664eb9931067e7219edd8bf7f242b10bef8596 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public struct AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -29,7 +34,4 @@ public struct AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapString, forKey: .mapString) try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index 0f825cf24d0c1e70d982fbd99b6995890ec442ca..5cfeded31771c7b466b8ee04830e0dfbed9dd59f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -17,6 +17,11 @@ public struct Animal: Codable, Hashable { self.className = className self.color = color } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -29,7 +34,4 @@ public struct Animal: Codable, Hashable { try container.encode(className, forKey: .className) try container.encodeIfPresent(color, forKey: .color) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index 2b66af2dc949ca862a275887f1a1d6eb82b2ff3f..1725960473c77287559f5609414aca1f33476948 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public struct ApiResponse: Codable, Hashable { self.type = type self.message = message } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -33,7 +38,4 @@ public struct ApiResponse: Codable, Hashable { try container.encodeIfPresent(type, forKey: .type) try container.encodeIfPresent(message, forKey: .message) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 06f0640475c26f4717b68ee9e31b81a49d765556..d794db2f6e23f8143a979abbd779bc7f1f166171 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 8c50c7fa1e441361129d2c551b453b091e166988..bc7d1c731eff5e2d2389c97c740eb27f3f56fca5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public struct ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -25,7 +30,4 @@ public struct ArrayOfNumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 461ec7cd9acf5961a714d5428c03496341325ef9..332d7685479d30793481191eeb1e34ffc2b01943 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public struct ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -33,7 +38,4 @@ public struct ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfInteger, forKey: .arrayArrayOfInteger) try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index fbe62983d5e983b08dfd0462e244413588152b75..1ec7ca4ce691ddd55465d358ee95efdc0c89e304 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -26,6 +26,11 @@ public struct Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -46,7 +51,4 @@ public struct Capitalization: Codable, Hashable { try container.encodeIfPresent(sCAETHFlowPoints, forKey: .sCAETHFlowPoints) try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 7f3a86932f1bfa02db200e618dcc1f84e4133760..4c82e60602a2d18430c58682001ab52cad318c82 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -19,6 +19,11 @@ public struct Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Cat: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift index 8df2395483246aa7ab293e4fe69b5466e80e7037..be5cf8fe676ab8d9edd9738033e303413824b817 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public struct CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -25,7 +30,4 @@ public struct CatAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(declawed, forKey: .declawed) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index 4109db4d1ef7316a7e9364e1c49497d97025b759..3749796740f300845129a160b64c384a3dbccfb8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -17,6 +17,11 @@ public struct Category: Codable, Hashable { self.id = id self.name = name } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Category: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encode(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 44ac733f2c529d36fbe566caa3acbb825c14bca8..6dda2ebeb32fe3436494fa41beb3778c663460fb 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -16,6 +16,11 @@ public struct ClassModel: Codable, Hashable { public init(`class`: String? = nil) { self.`class` = `class` } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case `class` = "_class" } @@ -26,7 +31,4 @@ public struct ClassModel: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(`class`, forKey: .`class`) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index 7d6eff2ffe1f8aa332a1e759ee54660af8bd656c..86cf75a71ecd014c7c93f88a1b9cfcfe44771b12 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -15,6 +15,11 @@ public struct Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -25,7 +30,4 @@ public struct Client: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(client, forKey: .client) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index b5f2bcea38a3fd936be8023a8d99df660854bed7..5de2d0f56da25056b0b9c2f1a450e3aad5267f9f 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -19,6 +19,11 @@ public struct Dog: Codable, Hashable { self.color = color self.breed = breed } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -33,7 +38,4 @@ public struct Dog: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift index 1bfa23d7bc6da605cc293d5969c2742b77a972b8..9e887e9e4152838727b01da40f0008d508bd294c 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public struct DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -25,7 +30,4 @@ public struct DogAllOf: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(breed, forKey: .breed) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 73368c421433628f53f301b5c2b3aea36d88f13c..5eff64f924c6b75a3d7e7e3b7079fb6f10dd19b3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public struct EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -37,7 +42,4 @@ public struct EnumArrays: Codable, Hashable { try container.encodeIfPresent(justSymbol, forKey: .justSymbol) try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 60a81bcac77bb12fbd2a7cfe10d0bf7709112e8f..9e40aa8f47faab12b4e18e1eee9f93a5a67537e1 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -41,6 +41,11 @@ public struct EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -59,7 +64,4 @@ public struct EnumTest: Codable, Hashable { try container.encodeIfPresent(enumNumber, forKey: .enumNumber) try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 90283656d1b3cb8873259de6a3a2502fc5c92d34..e529b45c23f88b88efdb87655cc0adf18b6c8cb0 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -17,6 +17,11 @@ public struct File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -27,7 +32,4 @@ public struct File: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index cff92673bbeb9f3b35a9257feeb6b6b1a6fc0f8d..dd5e5d41de197ee7a42967d8c3de25656b2bf61b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public struct FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -29,7 +34,4 @@ public struct FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(file, forKey: .file) try container.encodeIfPresent(files, forKey: .files) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index fc86676eec303e4d438c7a06adfea9db6bc2613e..971c2e54aa6bd4a5969fc08c8cd6a70956fb9a56 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -39,6 +39,11 @@ public struct FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -73,7 +78,4 @@ public struct FormatTest: Codable, Hashable { try container.encodeIfPresent(uuid, forKey: .uuid) try container.encode(password, forKey: .password) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index d7960f5c80086e8da4e2f15d7a2823c865cf79ec..5351e8bca6029e700dbaef9b2cc1e10e23b91eae 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public struct HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -29,7 +34,4 @@ public struct HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(foo, forKey: .foo) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index c5d4f2cae5675edc8736951f1749b3827adb42f2..b9389f5275bcd4daa8d1168db9643825eb6135ac 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -15,6 +15,11 @@ public struct List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -25,7 +30,4 @@ public struct List: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(_123list, forKey: ._123list) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index b54bd01e5dc9a21d0d578ae7ee2cf6a249f3445a..c2aab1c878c849f3138994e228f9b8ef56dd2b67 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -25,6 +25,11 @@ public struct MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -41,7 +46,4 @@ public struct MapTest: Codable, Hashable { try container.encodeIfPresent(directMap, forKey: .directMap) try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index c8f639ef43d06deeb90b16f07ce793909544b77f..ebd7518e468053acdf25eee79f22020653d7c055 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { self.dateTime = dateTime self.map = map } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -33,7 +38,4 @@ public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(dateTime, forKey: .dateTime) try container.encodeIfPresent(map, forKey: .map) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 9b7e3c46d8c0fd70be8b6dd10cd7710aac7faa27..afd3c0a62b448faa4adf10f4dbdc97b3c72d1b24 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -18,6 +18,11 @@ public struct Model200Response: Codable, Hashable { self.name = name self.`class` = `class` } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case `class` = "class" @@ -30,7 +35,4 @@ public struct Model200Response: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) try container.encodeIfPresent(`class`, forKey: .`class`) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 84a40e1c1016764dc3cc3f1bc48142b3baa1a483..03eb74fa174808d11a4e8e1196e01c32638d37df 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -22,6 +22,11 @@ public struct Name: Codable, Hashable { self.property = property self._123number = _123number } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -38,7 +43,4 @@ public struct Name: Codable, Hashable { try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 710f41648f90f6848f686ba03285efd7a8ed1a23..c62384f6463647f534c75835b2847436359cdcab 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public struct NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -25,7 +30,4 @@ public struct NumberOnly: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 15726ab16a47d1a802a0b61c69741117d1c3803e..4b686ec455be5598ae799b3af2351e24ef58ee00 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -31,6 +31,11 @@ public struct Order: Codable, Hashable { self.status = status self.complete = complete } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -51,7 +56,4 @@ public struct Order: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) try container.encodeIfPresent(complete, forKey: .complete) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 36904afbd508e3f1fff2acf3aa1c7ecc58e0beb0..760deba09373f786997969e5bb6d0324fe019e46 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public struct OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -33,7 +38,4 @@ public struct OuterComposite: Codable, Hashable { try container.encodeIfPresent(myString, forKey: .myString) try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 7a1c2826a195f392fc6f4c8d5a7fb26bcaeafe4f..53b0960b9635c9df6c75abec19e79dd45019da82 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -31,6 +31,11 @@ public struct Pet: Codable, Hashable { self.tags = tags self.status = status } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -51,7 +56,4 @@ public struct Pet: Codable, Hashable { try container.encodeIfPresent(tags, forKey: .tags) try container.encodeIfPresent(status, forKey: .status) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 38fb57af3287c19f93f0fd2a326b1debdb3780f4..90356f484600dd5909af2dff8f5b81d504be0fcc 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public struct ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -29,7 +34,4 @@ public struct ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(bar, forKey: .bar) try container.encodeIfPresent(baz, forKey: .baz) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 91d2d536a7b5645cc67f61611c5146d6c747bf06..10ac8f6e8165f526dbc6a59e06eb94a71caba85e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -16,6 +16,11 @@ public struct Return: Codable, Hashable { public init(`return`: Int? = nil) { self.`return` = `return` } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case `return` = "return" } @@ -26,7 +31,4 @@ public struct Return: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(`return`, forKey: .`return`) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 18747e071bc6d50707c4ed7b3f541d38f1551c50..16771cbd84a7c6073b4db288e2c49578c734c452 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public struct SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -25,7 +30,4 @@ public struct SpecialModelName: Codable, Hashable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 0699c25ff7ed19338239fdbcaa4f0e992df80e02..950427ad5f8cd83b4a42e37cb59e6010da567429 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -10,39 +10,17 @@ import AnyCodable public struct StringBooleanMap: Codable, Hashable { + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 11c5f7a750bb27db7b14db43ee83eb2cfaf76dbe..4d930f40d8544891a0b07d23958dd0711b021698 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -17,6 +17,11 @@ public struct Tag: Codable, Hashable { self.id = id self.name = name } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -29,7 +34,4 @@ public struct Tag: Codable, Hashable { try container.encodeIfPresent(id, forKey: .id) try container.encodeIfPresent(name, forKey: .name) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 35b1a5833b93ccedcf057f9832ea62281fff1e75..c2d34667a073b138078889edce72216a245f4305 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public struct TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderDefault: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 37277a4ac00a0bf452d946357b50e7c6bd115484..771d6f1c533ffa9209a01cea54475c56a3e49794 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public struct TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -41,7 +46,4 @@ public struct TypeHolderExample: Codable, Hashable { try container.encode(boolItem, forKey: .boolItem) try container.encode(arrayItem, forKey: .arrayItem) } - - - } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index 2bbc31806fff02ebb29f09b1da41181210664bdb..58e6a767279739ef01914419da2884d95ed48fd3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -30,6 +30,11 @@ public struct User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -54,7 +59,4 @@ public struct User: Codable, Hashable { try container.encodeIfPresent(phone, forKey: .phone) try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift index 3aef2d1d6c541de4d6f27de2c1539edc414cec8e..98faa027b3e0cb24740a127200dd6b39f2e69e17 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Extensions.swift @@ -7,6 +7,10 @@ import Foundation import AnyCodable +not disallowAdditionalPropertiesIfNotPresent + +not isAdditionalPropertiesTrue + extension Bool: JSONEncodable { func encodeToJSON() -> Any { return self as Any } } @@ -93,92 +97,6 @@ extension UUID: JSONEncodable { } } -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray<T>(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent<T>(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap<T>(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent<T>(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent<T>(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap<T>(_ type: T.Type, excludedKeys: Set<Self.Key>) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { return Array(200 ..< 300).contains(statusCode) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 5c3e8279143eaffe907425946a786c69cd235d41..2da9129bbbef0e8b518431cec2b571b69e0d033b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -17,6 +17,11 @@ public final class AdditionalPropertiesClass: Codable, Hashable { self.mapString = mapString self.mapMapString = mapMapString } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_string" @@ -30,8 +35,6 @@ public final class AdditionalPropertiesClass: Codable, Hashable { try container.encodeIfPresent(mapMapString, forKey: .mapMapString) } - - public static func == (lhs: AdditionalPropertiesClass, rhs: AdditionalPropertiesClass) -> Bool { lhs.mapString == rhs.mapString && lhs.mapMapString == rhs.mapMapString @@ -43,5 +46,4 @@ public final class AdditionalPropertiesClass: Codable, Hashable { hasher.combine(mapMapString?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift index 6bae9f2d0ecd0534c2e675085e46824d4c39888b..4aae19fa7b3c81a358d51058a536b77043eae887 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -17,6 +17,11 @@ public final class Animal: Codable, Hashable { self.className = className self.color = color } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -30,8 +35,6 @@ public final class Animal: Codable, Hashable { try container.encodeIfPresent(color, forKey: .color) } - - public static func == (lhs: Animal, rhs: Animal) -> Bool { lhs.className == rhs.className && lhs.color == rhs.color @@ -43,5 +46,4 @@ public final class Animal: Codable, Hashable { hasher.combine(color?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index a0f3a24a8ee9ce0c8484e1f10f1bcbf2ccc19c77..f35af8d2241f5cdb380d803b6bb34571367bd25e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -19,6 +19,11 @@ public final class ApiResponse: Codable, Hashable { self.type = type self.message = message } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case code case type @@ -34,8 +39,6 @@ public final class ApiResponse: Codable, Hashable { try container.encodeIfPresent(message, forKey: .message) } - - public static func == (lhs: ApiResponse, rhs: ApiResponse) -> Bool { lhs.code == rhs.code && lhs.type == rhs.type && @@ -49,5 +52,4 @@ public final class ApiResponse: Codable, Hashable { hasher.combine(message?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index b4b66b37be5e775f5c4d53e049e5b05e2c6a6e51..da9b45d9e517b1762f000694f6c686cc06bbcf44 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public final class ArrayOfArrayOfNumberOnly: Codable, Hashable { public init(arrayArrayNumber: [[Double]]? = nil) { self.arrayArrayNumber = arrayArrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } @@ -26,8 +31,6 @@ public final class ArrayOfArrayOfNumberOnly: Codable, Hashable { try container.encodeIfPresent(arrayArrayNumber, forKey: .arrayArrayNumber) } - - public static func == (lhs: ArrayOfArrayOfNumberOnly, rhs: ArrayOfArrayOfNumberOnly) -> Bool { lhs.arrayArrayNumber == rhs.arrayArrayNumber @@ -37,5 +40,4 @@ public final class ArrayOfArrayOfNumberOnly: Codable, Hashable { hasher.combine(arrayArrayNumber?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index 1efbc2aa9e4ddaa1429508c9fd4e0ae0d37ee580..4ab89f5f5d336c397ea9261c5e6f37cf4ecb4c0c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -15,6 +15,11 @@ public final class ArrayOfNumberOnly: Codable, Hashable { public init(arrayNumber: [Double]? = nil) { self.arrayNumber = arrayNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } @@ -26,8 +31,6 @@ public final class ArrayOfNumberOnly: Codable, Hashable { try container.encodeIfPresent(arrayNumber, forKey: .arrayNumber) } - - public static func == (lhs: ArrayOfNumberOnly, rhs: ArrayOfNumberOnly) -> Bool { lhs.arrayNumber == rhs.arrayNumber @@ -37,5 +40,4 @@ public final class ArrayOfNumberOnly: Codable, Hashable { hasher.combine(arrayNumber?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index 6ca479263d3c5395335d6adc8f6a276daf99b1e7..7dcf5e22a9f81217444a85c72bdc839bd25fffec 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -19,6 +19,11 @@ public final class ArrayTest: Codable, Hashable { self.arrayArrayOfInteger = arrayArrayOfInteger self.arrayArrayOfModel = arrayArrayOfModel } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" @@ -34,8 +39,6 @@ public final class ArrayTest: Codable, Hashable { try container.encodeIfPresent(arrayArrayOfModel, forKey: .arrayArrayOfModel) } - - public static func == (lhs: ArrayTest, rhs: ArrayTest) -> Bool { lhs.arrayOfString == rhs.arrayOfString && lhs.arrayArrayOfInteger == rhs.arrayArrayOfInteger && @@ -49,5 +52,4 @@ public final class ArrayTest: Codable, Hashable { hasher.combine(arrayArrayOfModel?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift index fd148a09d29992e92816663c675fe71fd2efecf9..738fbac493bea92f8725b7cdb62166ec0a397b61 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -26,6 +26,11 @@ public final class Capitalization: Codable, Hashable { self.sCAETHFlowPoints = sCAETHFlowPoints self.ATT_NAME = ATT_NAME } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" @@ -47,8 +52,6 @@ public final class Capitalization: Codable, Hashable { try container.encodeIfPresent(ATT_NAME, forKey: .ATT_NAME) } - - public static func == (lhs: Capitalization, rhs: Capitalization) -> Bool { lhs.smallCamel == rhs.smallCamel && lhs.capitalCamel == rhs.capitalCamel && @@ -68,5 +71,4 @@ public final class Capitalization: Codable, Hashable { hasher.combine(ATT_NAME?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift index 54b81364f35c46c9b633df559694ab9391d20de4..618393fa791603ba76b75e59b633ceed0783ee7a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -19,6 +19,11 @@ public final class Cat: Codable, Hashable { self.color = color self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -34,8 +39,6 @@ public final class Cat: Codable, Hashable { try container.encodeIfPresent(declawed, forKey: .declawed) } - - public static func == (lhs: Cat, rhs: Cat) -> Bool { lhs.className == rhs.className && lhs.color == rhs.color && @@ -49,5 +52,4 @@ public final class Cat: Codable, Hashable { hasher.combine(declawed?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift index 5074d59cb5dfbb031ca780d28bf9be7ad4fbe8d1..e99cc1bd7feef59d86f32b1d41331ba65b4f3696 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/CatAllOf.swift @@ -15,6 +15,11 @@ public final class CatAllOf: Codable, Hashable { public init(declawed: Bool? = nil) { self.declawed = declawed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case declawed } @@ -26,8 +31,6 @@ public final class CatAllOf: Codable, Hashable { try container.encodeIfPresent(declawed, forKey: .declawed) } - - public static func == (lhs: CatAllOf, rhs: CatAllOf) -> Bool { lhs.declawed == rhs.declawed @@ -37,5 +40,4 @@ public final class CatAllOf: Codable, Hashable { hasher.combine(declawed?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift index 242fc578d458bc544aa66610a849e78f0486a6b9..0d19bcbb83a14fa5dc4348ebcd0432a75eae422a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift @@ -17,6 +17,11 @@ public final class Category: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -30,8 +35,6 @@ public final class Category: Codable, Hashable { try container.encode(name, forKey: .name) } - - public static func == (lhs: Category, rhs: Category) -> Bool { lhs.id == rhs.id && lhs.name == rhs.name @@ -43,5 +46,4 @@ public final class Category: Codable, Hashable { hasher.combine(name.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift index ba363df9d14d66f08ec69e398d28d687a514af5b..b8695b9470ef5faa6ddf0480479a238ad5e04dc2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -16,6 +16,11 @@ public final class ClassModel: Codable, Hashable { public init(_class: String? = nil) { self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _class } @@ -27,8 +32,6 @@ public final class ClassModel: Codable, Hashable { try container.encodeIfPresent(_class, forKey: ._class) } - - public static func == (lhs: ClassModel, rhs: ClassModel) -> Bool { lhs._class == rhs._class @@ -38,5 +41,4 @@ public final class ClassModel: Codable, Hashable { hasher.combine(_class?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift index 323ab20082de17e47a299b852715bc5945e88202..4af5bb7dc5e119a4a94b7cdeb143f748ae994da3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift @@ -15,6 +15,11 @@ public final class Client: Codable, Hashable { public init(client: String? = nil) { self.client = client } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case client } @@ -26,8 +31,6 @@ public final class Client: Codable, Hashable { try container.encodeIfPresent(client, forKey: .client) } - - public static func == (lhs: Client, rhs: Client) -> Bool { lhs.client == rhs.client @@ -37,5 +40,4 @@ public final class Client: Codable, Hashable { hasher.combine(client?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift index ec8a67480353693d944c4dc2b5f2000981c4eb93..6946506373bc94e2b3be0739cdc5933b61afb921 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -19,6 +19,11 @@ public final class Dog: Codable, Hashable { self.color = color self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case className case color @@ -34,8 +39,6 @@ public final class Dog: Codable, Hashable { try container.encodeIfPresent(breed, forKey: .breed) } - - public static func == (lhs: Dog, rhs: Dog) -> Bool { lhs.className == rhs.className && lhs.color == rhs.color && @@ -49,5 +52,4 @@ public final class Dog: Codable, Hashable { hasher.combine(breed?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift index 82d185f1a42b6a0edaef3a4d23929ad83eb02f54..f50ec577b163741770ebbf28a8d33c34bab06bef 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/DogAllOf.swift @@ -15,6 +15,11 @@ public final class DogAllOf: Codable, Hashable { public init(breed: String? = nil) { self.breed = breed } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case breed } @@ -26,8 +31,6 @@ public final class DogAllOf: Codable, Hashable { try container.encodeIfPresent(breed, forKey: .breed) } - - public static func == (lhs: DogAllOf, rhs: DogAllOf) -> Bool { lhs.breed == rhs.breed @@ -37,5 +40,4 @@ public final class DogAllOf: Codable, Hashable { hasher.combine(breed?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index 573cb86e1ba70d5ab9ab27ed3548e68413a126c2..db66155a4adf7260b59e1e1e1734eb4f7d40290a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -25,6 +25,11 @@ public final class EnumArrays: Codable, Hashable { self.justSymbol = justSymbol self.arrayEnum = arrayEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" @@ -38,8 +43,6 @@ public final class EnumArrays: Codable, Hashable { try container.encodeIfPresent(arrayEnum, forKey: .arrayEnum) } - - public static func == (lhs: EnumArrays, rhs: EnumArrays) -> Bool { lhs.justSymbol == rhs.justSymbol && lhs.arrayEnum == rhs.arrayEnum @@ -51,5 +54,4 @@ public final class EnumArrays: Codable, Hashable { hasher.combine(arrayEnum?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift index ca04771171b9eb49480fa7a7418438c602203fe5..d6bac00c175b52e6149a423277ae88d07e81ee68 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -41,6 +41,11 @@ public final class EnumTest: Codable, Hashable { self.enumNumber = enumNumber self.outerEnum = outerEnum } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" @@ -60,8 +65,6 @@ public final class EnumTest: Codable, Hashable { try container.encodeIfPresent(outerEnum, forKey: .outerEnum) } - - public static func == (lhs: EnumTest, rhs: EnumTest) -> Bool { lhs.enumString == rhs.enumString && lhs.enumStringRequired == rhs.enumStringRequired && @@ -79,5 +82,4 @@ public final class EnumTest: Codable, Hashable { hasher.combine(outerEnum?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift index a899d021b870cb29b2c715b7051fa54b2f016855..ab7c338caaf8e7a0da01a2b1583d3c4d538eaf38 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift @@ -17,6 +17,11 @@ public final class File: Codable, Hashable { public init(sourceURI: String? = nil) { self.sourceURI = sourceURI } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case sourceURI } @@ -28,8 +33,6 @@ public final class File: Codable, Hashable { try container.encodeIfPresent(sourceURI, forKey: .sourceURI) } - - public static func == (lhs: File, rhs: File) -> Bool { lhs.sourceURI == rhs.sourceURI @@ -39,5 +42,4 @@ public final class File: Codable, Hashable { hasher.combine(sourceURI?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 2465bd5103f4a8b7236637f67cce7454f7033cb6..84e08e43ee9bd7c9c83414748ab8ab29c0e1b69c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -17,6 +17,11 @@ public final class FileSchemaTestClass: Codable, Hashable { self.file = file self.files = files } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case file case files @@ -30,8 +35,6 @@ public final class FileSchemaTestClass: Codable, Hashable { try container.encodeIfPresent(files, forKey: .files) } - - public static func == (lhs: FileSchemaTestClass, rhs: FileSchemaTestClass) -> Bool { lhs.file == rhs.file && lhs.files == rhs.files @@ -43,5 +46,4 @@ public final class FileSchemaTestClass: Codable, Hashable { hasher.combine(files?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 52c9d58241f670542d832e634febe960471c366e..d0235905c19216fe49a69d274bacc443d3675c7e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -39,6 +39,11 @@ public final class FormatTest: Codable, Hashable { self.uuid = uuid self.password = password } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case integer case int32 @@ -74,8 +79,6 @@ public final class FormatTest: Codable, Hashable { try container.encode(password, forKey: .password) } - - public static func == (lhs: FormatTest, rhs: FormatTest) -> Bool { lhs.integer == rhs.integer && lhs.int32 == rhs.int32 && @@ -109,5 +112,4 @@ public final class FormatTest: Codable, Hashable { hasher.combine(password.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index 4044065d4f892f952b9758e8c7dbb894e2a9b48d..e01bf4601853bdfb95eb5a0055cf8e1c3f4352a6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -17,6 +17,11 @@ public final class HasOnlyReadOnly: Codable, Hashable { self.bar = bar self.foo = foo } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case foo @@ -30,8 +35,6 @@ public final class HasOnlyReadOnly: Codable, Hashable { try container.encodeIfPresent(foo, forKey: .foo) } - - public static func == (lhs: HasOnlyReadOnly, rhs: HasOnlyReadOnly) -> Bool { lhs.bar == rhs.bar && lhs.foo == rhs.foo @@ -43,5 +46,4 @@ public final class HasOnlyReadOnly: Codable, Hashable { hasher.combine(foo?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift index c2457325b5bc7cc3203a873053ec02d0ee96dfb0..8887f89521022f89d1c93373263c2511e79b907c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift @@ -15,6 +15,11 @@ public final class List: Codable, Hashable { public init(_123list: String? = nil) { self._123list = _123list } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } @@ -26,8 +31,6 @@ public final class List: Codable, Hashable { try container.encodeIfPresent(_123list, forKey: ._123list) } - - public static func == (lhs: List, rhs: List) -> Bool { lhs._123list == rhs._123list @@ -37,5 +40,4 @@ public final class List: Codable, Hashable { hasher.combine(_123list?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift index 83a6f77e76ef5d13c5d0b8533469e73d3eeb9acd..733753df1d6ef8c99d0f2296e075219889062be6 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -25,6 +25,11 @@ public final class MapTest: Codable, Hashable { self.directMap = directMap self.indirectMap = indirectMap } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" @@ -42,8 +47,6 @@ public final class MapTest: Codable, Hashable { try container.encodeIfPresent(indirectMap, forKey: .indirectMap) } - - public static func == (lhs: MapTest, rhs: MapTest) -> Bool { lhs.mapMapOfString == rhs.mapMapOfString && lhs.mapOfEnumString == rhs.mapOfEnumString && @@ -59,5 +62,4 @@ public final class MapTest: Codable, Hashable { hasher.combine(indirectMap?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 08222b23f5cf4b6ac02f5ca957739d2cff59d395..e22607328ed7af037676fa122a9d22560008f047 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -19,6 +19,11 @@ public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashabl self.dateTime = dateTime self.map = map } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case uuid case dateTime @@ -34,8 +39,6 @@ public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashabl try container.encodeIfPresent(map, forKey: .map) } - - public static func == (lhs: MixedPropertiesAndAdditionalPropertiesClass, rhs: MixedPropertiesAndAdditionalPropertiesClass) -> Bool { lhs.uuid == rhs.uuid && lhs.dateTime == rhs.dateTime && @@ -49,5 +52,4 @@ public final class MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashabl hasher.combine(map?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift index 10290c43c3e12a537b8189f33c163195cbb374ca..ee149996927b372230ec30098ab5ef72aac9c642 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -18,6 +18,11 @@ public final class Model200Response: Codable, Hashable { self.name = name self._class = _class } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" @@ -31,8 +36,6 @@ public final class Model200Response: Codable, Hashable { try container.encodeIfPresent(_class, forKey: ._class) } - - public static func == (lhs: Model200Response, rhs: Model200Response) -> Bool { lhs.name == rhs.name && lhs._class == rhs._class @@ -44,5 +47,4 @@ public final class Model200Response: Codable, Hashable { hasher.combine(_class?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift index 533e5f2aea3de705fe1c2efe10efc950528695f2..dcdd370828550dabe27a1e7ba88b666a520d3928 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift @@ -22,6 +22,11 @@ public final class Name: Codable, Hashable { self.property = property self._123number = _123number } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" @@ -39,8 +44,6 @@ public final class Name: Codable, Hashable { try container.encodeIfPresent(_123number, forKey: ._123number) } - - public static func == (lhs: Name, rhs: Name) -> Bool { lhs.name == rhs.name && lhs.snakeCase == rhs.snakeCase && @@ -56,5 +59,4 @@ public final class Name: Codable, Hashable { hasher.combine(_123number?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index be9925066cec7ccab864105c2a71424281f85e06..5e5e2649409ff5c04c1ac2ba13ad141308e0e89e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -15,6 +15,11 @@ public final class NumberOnly: Codable, Hashable { public init(justNumber: Double? = nil) { self.justNumber = justNumber } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } @@ -26,8 +31,6 @@ public final class NumberOnly: Codable, Hashable { try container.encodeIfPresent(justNumber, forKey: .justNumber) } - - public static func == (lhs: NumberOnly, rhs: NumberOnly) -> Bool { lhs.justNumber == rhs.justNumber @@ -37,5 +40,4 @@ public final class NumberOnly: Codable, Hashable { hasher.combine(justNumber?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift index cfce5645a20f5d961d31e585bf609f0224fc82d1..a403ea055899acc791c6d98f39d5914decb7210d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift @@ -31,6 +31,11 @@ public final class Order: Codable, Hashable { self.status = status self.complete = complete } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case petId @@ -52,8 +57,6 @@ public final class Order: Codable, Hashable { try container.encodeIfPresent(complete, forKey: .complete) } - - public static func == (lhs: Order, rhs: Order) -> Bool { lhs.id == rhs.id && lhs.petId == rhs.petId && @@ -73,5 +76,4 @@ public final class Order: Codable, Hashable { hasher.combine(complete?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index d238c4c13ddfb92050b6a8a31dc913b37dda4c3e..81ded66ec0136c0f65273813140f8f16b8a3ce92 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -19,6 +19,11 @@ public final class OuterComposite: Codable, Hashable { self.myString = myString self.myBoolean = myBoolean } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" @@ -34,8 +39,6 @@ public final class OuterComposite: Codable, Hashable { try container.encodeIfPresent(myBoolean, forKey: .myBoolean) } - - public static func == (lhs: OuterComposite, rhs: OuterComposite) -> Bool { lhs.myNumber == rhs.myNumber && lhs.myString == rhs.myString && @@ -49,5 +52,4 @@ public final class OuterComposite: Codable, Hashable { hasher.combine(myBoolean?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift index c036d6d0cfbc1f63f354909e0fcf37b4177c0b22..b53b34fc45d59d0ef35269b481676998b2582a57 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -31,6 +31,11 @@ public final class Pet: Codable, Hashable { self.tags = tags self.status = status } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case category @@ -52,8 +57,6 @@ public final class Pet: Codable, Hashable { try container.encodeIfPresent(status, forKey: .status) } - - public static func == (lhs: Pet, rhs: Pet) -> Bool { lhs.id == rhs.id && lhs.category == rhs.category && @@ -73,5 +76,4 @@ public final class Pet: Codable, Hashable { hasher.combine(status?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 1e2cdb966f21eb520757325c81d7ac6ae763889c..9068cd35225988dad5c7e044f57af061d8778867 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -17,6 +17,11 @@ public final class ReadOnlyFirst: Codable, Hashable { self.bar = bar self.baz = baz } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case bar case baz @@ -30,8 +35,6 @@ public final class ReadOnlyFirst: Codable, Hashable { try container.encodeIfPresent(baz, forKey: .baz) } - - public static func == (lhs: ReadOnlyFirst, rhs: ReadOnlyFirst) -> Bool { lhs.bar == rhs.bar && lhs.baz == rhs.baz @@ -43,5 +46,4 @@ public final class ReadOnlyFirst: Codable, Hashable { hasher.combine(baz?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift index c28939bb89d40485b6c649c1ff31f6f5124393ed..d262d80836e7d6e79806f23b16d814ae769d24ee 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift @@ -16,6 +16,11 @@ public final class Return: Codable, Hashable { public init(_return: Int? = nil) { self._return = _return } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } @@ -27,8 +32,6 @@ public final class Return: Codable, Hashable { try container.encodeIfPresent(_return, forKey: ._return) } - - public static func == (lhs: Return, rhs: Return) -> Bool { lhs._return == rhs._return @@ -38,5 +41,4 @@ public final class Return: Codable, Hashable { hasher.combine(_return?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index 3fd247331743fa62290f1bc63784c29715a30800..7e30db1aeb6dbbfcfb2e7bad0819970211694ad2 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -15,6 +15,11 @@ public final class SpecialModelName: Codable, Hashable { public init(specialPropertyName: Int64? = nil) { self.specialPropertyName = specialPropertyName } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } @@ -26,8 +31,6 @@ public final class SpecialModelName: Codable, Hashable { try container.encodeIfPresent(specialPropertyName, forKey: .specialPropertyName) } - - public static func == (lhs: SpecialModelName, rhs: SpecialModelName) -> Bool { lhs.specialPropertyName == rhs.specialPropertyName @@ -37,5 +40,4 @@ public final class SpecialModelName: Codable, Hashable { hasher.combine(specialPropertyName?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index 9e90edf7be9c9dfe38b24be6ef7b1054e8f2007c..be184ecaec9671ee34ab0257d347b319ff956c8d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -10,47 +10,25 @@ import AnyCodable public final class StringBooleanMap: Codable, Hashable { + + not disallowAdditionalPropertiesIfNotPresent + + not isAdditionalPropertiesTrue + public enum CodingKeys: CodingKey, CaseIterable { } - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } // Encodable protocol methods public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - var additionalPropertiesContainer = encoder.container(keyedBy: String.self) - try additionalPropertiesContainer.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set<String>() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - public static func == (lhs: StringBooleanMap, rhs: StringBooleanMap) -> Bool { - lhs.additionalProperties == rhs.additionalProperties + } public func hash(into hasher: inout Hasher) { - hasher.combine(additionalProperties.hashValue) + } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift index b30b0f62aceec88d364e55a2d808c569ddd65267..5421e239b8736dedcf8bc7b03f3f4ec50be5149c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -17,6 +17,11 @@ public final class Tag: Codable, Hashable { self.id = id self.name = name } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case name @@ -30,8 +35,6 @@ public final class Tag: Codable, Hashable { try container.encodeIfPresent(name, forKey: .name) } - - public static func == (lhs: Tag, rhs: Tag) -> Bool { lhs.id == rhs.id && lhs.name == rhs.name @@ -43,5 +46,4 @@ public final class Tag: Codable, Hashable { hasher.combine(name?.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index f99b86d1d642c7d8ef5cca36b431404f3ec52d1c..cc522f9317b5a9abffb9ccf6f1b5864ddbace203 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -23,6 +23,11 @@ public final class TypeHolderDefault: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -42,8 +47,6 @@ public final class TypeHolderDefault: Codable, Hashable { try container.encode(arrayItem, forKey: .arrayItem) } - - public static func == (lhs: TypeHolderDefault, rhs: TypeHolderDefault) -> Bool { lhs.stringItem == rhs.stringItem && lhs.numberItem == rhs.numberItem && @@ -61,5 +64,4 @@ public final class TypeHolderDefault: Codable, Hashable { hasher.combine(arrayItem.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index d266ad2f0d1890312c4e8a7c37261a0c99a1c8dd..5af0c8b5b51578ec03e31aec5bfc3e27c2a9dff5 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -23,6 +23,11 @@ public final class TypeHolderExample: Codable, Hashable { self.boolItem = boolItem self.arrayItem = arrayItem } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" @@ -42,8 +47,6 @@ public final class TypeHolderExample: Codable, Hashable { try container.encode(arrayItem, forKey: .arrayItem) } - - public static func == (lhs: TypeHolderExample, rhs: TypeHolderExample) -> Bool { lhs.stringItem == rhs.stringItem && lhs.numberItem == rhs.numberItem && @@ -61,5 +64,4 @@ public final class TypeHolderExample: Codable, Hashable { hasher.combine(arrayItem.hashValue) } - } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift index dcbecdf498d875c25319693e13fe0927a87be28f..67a4bac44087cd4008fb958d6d079c14a81739d5 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift @@ -30,6 +30,11 @@ public final class User: Codable, Hashable { self.phone = phone self.userStatus = userStatus } + + not disallowAdditionalPropertiesIfNotPresent + + isAdditionalPropertiesTrue + public enum CodingKeys: String, CodingKey, CaseIterable { case id case username @@ -55,8 +60,6 @@ public final class User: Codable, Hashable { try container.encodeIfPresent(userStatus, forKey: .userStatus) } - - public static func == (lhs: User, rhs: User) -> Bool { lhs.id == rhs.id && lhs.username == rhs.username && @@ -80,5 +83,4 @@ public final class User: Codable, Hashable { hasher.combine(userStatus?.hashValue) } - }