mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 07:01:01 +00:00
update samples
This commit is contained in:
parent
338812114c
commit
4948ce78ed
@ -5,7 +5,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
extension Bool: JSONEncodable {
|
extension Bool: JSONEncodable {
|
||||||
func encodeToJSON() -> Any { return self as Any }
|
func encodeToJSON() -> Any { return self as Any }
|
||||||
@ -185,6 +187,7 @@ extension HTTPURLResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if canImport(AnyCodable)
|
||||||
extension AnyCodable: Hashable {
|
extension AnyCodable: Hashable {
|
||||||
public func hash(into hasher: inout Hasher) {
|
public func hash(into hasher: inout Hasher) {
|
||||||
switch value {
|
switch value {
|
||||||
@ -225,3 +228,4 @@ extension AnyCodable: Hashable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct AdditionalPropertiesClass: Codable {
|
public struct AdditionalPropertiesClass: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Animal: Codable {
|
public struct Animal: Codable {
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public typealias AnimalFarm = [Animal]
|
public typealias AnimalFarm = [Animal]
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct ApiResponse: Codable {
|
public struct ApiResponse: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct ArrayOfArrayOfNumberOnly: Codable {
|
public struct ArrayOfArrayOfNumberOnly: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct ArrayOfNumberOnly: Codable {
|
public struct ArrayOfNumberOnly: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct ArrayTest: Codable {
|
public struct ArrayTest: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Capitalization: Codable {
|
public struct Capitalization: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Cat: Codable {
|
public struct Cat: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct CatAllOf: Codable {
|
public struct CatAllOf: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Category: Codable, Hashable {
|
public struct Category: Codable, Hashable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Model for testing model with \"_class\" property */
|
/** Model for testing model with \"_class\" property */
|
||||||
public struct ClassModel: Codable {
|
public struct ClassModel: Codable {
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Client: Codable {
|
public struct Client: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Dog: Codable {
|
public struct Dog: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct DogAllOf: Codable {
|
public struct DogAllOf: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct EnumArrays: Codable {
|
public struct EnumArrays: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public enum EnumClass: String, Codable, CaseIterable {
|
public enum EnumClass: String, Codable, CaseIterable {
|
||||||
case abc = "_abc"
|
case abc = "_abc"
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct EnumTest: Codable {
|
public struct EnumTest: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Must be named `File` for test. */
|
/** Must be named `File` for test. */
|
||||||
public struct File: Codable {
|
public struct File: Codable {
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct FileSchemaTestClass: Codable {
|
public struct FileSchemaTestClass: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct FormatTest: Codable {
|
public struct FormatTest: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct HasOnlyReadOnly: Codable {
|
public struct HasOnlyReadOnly: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct List: Codable {
|
public struct List: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct MapTest: Codable {
|
public struct MapTest: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct MixedPropertiesAndAdditionalPropertiesClass: Codable {
|
public struct MixedPropertiesAndAdditionalPropertiesClass: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Model for testing model name starting with number */
|
/** Model for testing model name starting with number */
|
||||||
public struct Model200Response: Codable {
|
public struct Model200Response: Codable {
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Model for testing model name same as property name */
|
/** Model for testing model name same as property name */
|
||||||
public struct Name: Codable {
|
public struct Name: Codable {
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct NumberOnly: Codable {
|
public struct NumberOnly: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Order: Codable {
|
public struct Order: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct OuterComposite: Codable {
|
public struct OuterComposite: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public enum OuterEnum: String, Codable, CaseIterable {
|
public enum OuterEnum: String, Codable, CaseIterable {
|
||||||
case placed = "placed"
|
case placed = "placed"
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Pet: Codable, Hashable {
|
public struct Pet: Codable, Hashable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct ReadOnlyFirst: Codable {
|
public struct ReadOnlyFirst: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Model for testing reserved words */
|
/** Model for testing reserved words */
|
||||||
public struct Return: Codable {
|
public struct Return: Codable {
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct SpecialModelName: Codable {
|
public struct SpecialModelName: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct StringBooleanMap: Codable {
|
public struct StringBooleanMap: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct Tag: Codable, Hashable {
|
public struct Tag: Codable, Hashable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct TypeHolderDefault: Codable {
|
public struct TypeHolderDefault: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct TypeHolderExample: Codable {
|
public struct TypeHolderExample: Codable {
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
#if canImport(AnyCodable)
|
||||||
import AnyCodable
|
import AnyCodable
|
||||||
|
#endif
|
||||||
|
|
||||||
public struct User: Codable {
|
public struct User: Codable {
|
||||||
|
|
||||||
|
@ -11,5 +11,5 @@ targets:
|
|||||||
settings:
|
settings:
|
||||||
APPLICATION_EXTENSION_API_ONLY: true
|
APPLICATION_EXTENSION_API_ONLY: true
|
||||||
scheme: {}
|
scheme: {}
|
||||||
|
dependencies:
|
||||||
- carthage: AnyCodable
|
- carthage: AnyCodable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user