update samples

This commit is contained in:
William Cheng 2021-05-21 12:54:40 +08:00
parent 338812114c
commit 4948ce78ed
42 changed files with 86 additions and 2 deletions

View File

@ -5,7 +5,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
extension Bool: JSONEncodable {
func encodeToJSON() -> Any { return self as Any }
@ -185,6 +187,7 @@ extension HTTPURLResponse {
}
}
#if canImport(AnyCodable)
extension AnyCodable: Hashable {
public func hash(into hasher: inout Hasher) {
switch value {
@ -224,4 +227,5 @@ extension AnyCodable: Hashable {
hasher.combine(0)
}
}
}
}
#endif

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct AdditionalPropertiesClass: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Animal: Codable {

View File

@ -6,6 +6,8 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public typealias AnimalFarm = [Animal]

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct ApiResponse: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct ArrayOfArrayOfNumberOnly: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct ArrayOfNumberOnly: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct ArrayTest: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Capitalization: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Cat: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct CatAllOf: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Category: Codable, Hashable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
/** Model for testing model with \"_class\" property */
public struct ClassModel: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Client: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Dog: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct DogAllOf: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct EnumArrays: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public enum EnumClass: String, Codable, CaseIterable {
case abc = "_abc"

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct EnumTest: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
/** Must be named `File` for test. */
public struct File: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct FileSchemaTestClass: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct FormatTest: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct HasOnlyReadOnly: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct List: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct MapTest: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct MixedPropertiesAndAdditionalPropertiesClass: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
/** Model for testing model name starting with number */
public struct Model200Response: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
/** Model for testing model name same as property name */
public struct Name: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct NumberOnly: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Order: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct OuterComposite: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public enum OuterEnum: String, Codable, CaseIterable {
case placed = "placed"

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Pet: Codable, Hashable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct ReadOnlyFirst: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
/** Model for testing reserved words */
public struct Return: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct SpecialModelName: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct StringBooleanMap: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct Tag: Codable, Hashable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct TypeHolderDefault: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct TypeHolderExample: Codable {

View File

@ -6,7 +6,9 @@
//
import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif
public struct User: Codable {

View File

@ -11,5 +11,5 @@ targets:
settings:
APPLICATION_EXTENSION_API_ONLY: true
scheme: {}
dependencies:
- carthage: AnyCodable