forked from loafle/openapi-generator-original
[Swift5] small improvements to Objc compatibility (#5410)
* [swift] make some small improvements * [swift][client] revert model to use allVars * PostProcessModelProperty with allVars * PostProcessModelProperty with vars * [swift] improve objc interoperability * [swift] fix swift4 for CI to pass * [swift] improve objc interoperability * [swift] improve objc interoperability * Swift - try to fix build * [swift] remove pods from git
This commit is contained in:
@@ -80,12 +80,6 @@ extension URL: JSONEncodable {
|
||||
}
|
||||
}
|
||||
|
||||
extension URL: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self
|
||||
}
|
||||
}
|
||||
|
||||
extension UUID: JSONEncodable {
|
||||
func encodeToJSON() -> Any {
|
||||
return self.uuidString
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** Object which contains lots of different primitive OpenAPI types */
|
||||
|
||||
public struct AllPrimitives: Codable {
|
||||
|
||||
public enum MyInlineStringEnum: String, Codable {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is a base card object which uses a 'cardType' discriminator. */
|
||||
|
||||
public struct BaseCard: Codable {
|
||||
|
||||
public var cardType: String
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** Example Error object */
|
||||
|
||||
public struct ErrorInfo: Codable {
|
||||
|
||||
public var code: Int?
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** Response object containing AllPrimitives object */
|
||||
|
||||
public struct GetAllModelsResult: Codable {
|
||||
|
||||
public var myPrimitiveArray: [AllPrimitives]?
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is an empty model with no properties and only additionalProperties of type int32 */
|
||||
|
||||
public struct ModelWithIntAdditionalPropertiesOnly: Codable {
|
||||
|
||||
public var additionalProperties: [String: Int] = [:]
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is an empty model with no properties and only additionalProperties of type int32 */
|
||||
|
||||
public struct ModelWithPropertiesAndAdditionalProperties: Codable {
|
||||
|
||||
public var myIntegerReq: Int
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is an empty model with no properties and only additionalProperties of type string */
|
||||
|
||||
public struct ModelWithStringAdditionalPropertiesOnly: Codable {
|
||||
|
||||
public var additionalProperties: [String: String] = [:]
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is a card object for a Person derived from BaseCard. */
|
||||
|
||||
public struct PersonCard: Codable {
|
||||
|
||||
public var cardType: String
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is a card object for a Person derived from BaseCard. */
|
||||
|
||||
public struct PlaceCard: Codable {
|
||||
|
||||
public var cardType: String
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is a base class object from which other classes will derive. */
|
||||
|
||||
public struct SampleBase: Codable {
|
||||
|
||||
public var baseClassStringProp: String?
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This is a subclass defived from the SampleBase class. */
|
||||
|
||||
public struct SampleSubClass: Codable {
|
||||
|
||||
public var baseClassStringProp: String?
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
/** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */
|
||||
|
||||
public struct VariableNameTest: Codable {
|
||||
|
||||
/** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */
|
||||
|
||||
Reference in New Issue
Block a user