Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hashable for Struct #9166

Merged
merged 3 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct {{classname}}: Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} {
{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct {{classname}}: Codable, Hashable {
{{/objcCompatible}}{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable {
{{/objcCompatible}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,6 @@ definitions:
xml:
name: Order
Category:
x-swift-hashable: true
type: object
required:
- name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct AdditionalPropertiesClass: Codable {
public struct AdditionalPropertiesClass: Codable, Hashable {

public var mapString: [String: String]?
public var mapMapString: [String: [String: String]]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Animal: Codable {
public struct Animal: Codable, Hashable {

public var className: String
public var color: String? = "red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ApiResponse: Codable {
public struct ApiResponse: Codable, Hashable {

public var code: Int?
public var type: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ArrayOfArrayOfNumberOnly: Codable {
public struct ArrayOfArrayOfNumberOnly: Codable, Hashable {

public var arrayArrayNumber: [[Double]]?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ArrayOfNumberOnly: Codable {
public struct ArrayOfNumberOnly: Codable, Hashable {

public var arrayNumber: [Double]?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ArrayTest: Codable {
public struct ArrayTest: Codable, Hashable {

public var arrayOfString: [String]?
public var arrayArrayOfInteger: [[Int64]]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Capitalization: Codable {
public struct Capitalization: Codable, Hashable {

public var smallCamel: String?
public var capitalCamel: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Cat: Codable {
public struct Cat: Codable, Hashable {

public var className: String
public var color: String? = "red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct CatAllOf: Codable {
public struct CatAllOf: Codable, Hashable {

public var declawed: Bool?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/** Model for testing model with \"_class\" property */
public struct ClassModel: Codable {
public struct ClassModel: Codable, Hashable {

public var _class: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Client: Codable {
public struct Client: Codable, Hashable {

public var client: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Dog: Codable {
public struct Dog: Codable, Hashable {

public var className: String
public var color: String? = "red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct DogAllOf: Codable {
public struct DogAllOf: Codable, Hashable {

public var breed: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct EnumArrays: Codable {
public struct EnumArrays: Codable, Hashable {

public enum JustSymbol: String, Codable, CaseIterable {
case greaterThanOrEqualTo = ">="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct EnumTest: Codable {
public struct EnumTest: Codable, Hashable {

public enum EnumString: String, Codable, CaseIterable {
case upper = "UPPER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/** Must be named `File` for test. */
public struct File: Codable {
public struct File: Codable, Hashable {

/** Test capitalization */
public var sourceURI: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct FileSchemaTestClass: Codable {
public struct FileSchemaTestClass: Codable, Hashable {

public var file: File?
public var files: [File]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct FormatTest: Codable {
public struct FormatTest: Codable, Hashable {

public var integer: Int?
public var int32: Int?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct HasOnlyReadOnly: Codable {
public struct HasOnlyReadOnly: Codable, Hashable {

public var bar: String?
public var foo: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct List: Codable {
public struct List: Codable, Hashable {

public var _123list: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct MapTest: Codable {
public struct MapTest: Codable, Hashable {

public enum MapOfEnumString: String, Codable, CaseIterable {
case upper = "UPPER"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct MixedPropertiesAndAdditionalPropertiesClass: Codable {
public struct MixedPropertiesAndAdditionalPropertiesClass: Codable, Hashable {

public var uuid: UUID?
public var dateTime: Date?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/** Model for testing model name starting with number */
public struct Model200Response: Codable {
public struct Model200Response: Codable, Hashable {

public var name: Int?
public var _class: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/** Model for testing model name same as property name */
public struct Name: Codable {
public struct Name: Codable, Hashable {

public var name: Int
public var snakeCase: Int?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct NumberOnly: Codable {
public struct NumberOnly: Codable, Hashable {

public var justNumber: Double?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Order: Codable {
public struct Order: Codable, Hashable {

public enum Status: String, Codable, CaseIterable {
case placed = "placed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct OuterComposite: Codable {
public struct OuterComposite: Codable, Hashable {

public var myNumber: Double?
public var myString: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ReadOnlyFirst: Codable {
public struct ReadOnlyFirst: Codable, Hashable {

public var bar: String?
public var baz: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/** Model for testing reserved words */
public struct Return: Codable {
public struct Return: Codable, Hashable {

public var _return: Int?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct SpecialModelName: Codable {
public struct SpecialModelName: Codable, Hashable {

public var specialPropertyName: Int64?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct StringBooleanMap: Codable {
public struct StringBooleanMap: Codable, Hashable {

public var additionalProperties: [String: Bool] = [:]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct TypeHolderDefault: Codable {
public struct TypeHolderDefault: Codable, Hashable {

public var stringItem: String = "what"
public var numberItem: Double
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct TypeHolderExample: Codable {
public struct TypeHolderExample: Codable, Hashable {

public var stringItem: String
public var numberItem: Double
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct User: Codable {
public struct User: Codable, Hashable {

public var id: Int64?
public var username: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct AdditionalPropertiesClass: Codable {
public struct AdditionalPropertiesClass: Codable, Hashable {

public var mapString: [String: String]?
public var mapMapString: [String: [String: String]]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Animal: Codable {
public struct Animal: Codable, Hashable {

public var className: String
public var color: String? = "red"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ApiResponse: Codable {
public struct ApiResponse: Codable, Hashable {

public var code: Int?
public var type: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ArrayOfArrayOfNumberOnly: Codable {
public struct ArrayOfArrayOfNumberOnly: Codable, Hashable {

public var arrayArrayNumber: [[Double]]?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ArrayOfNumberOnly: Codable {
public struct ArrayOfNumberOnly: Codable, Hashable {

public var arrayNumber: [Double]?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct ArrayTest: Codable {
public struct ArrayTest: Codable, Hashable {

public var arrayOfString: [String]?
public var arrayArrayOfInteger: [[Int64]]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Capitalization: Codable {
public struct Capitalization: Codable, Hashable {

public var smallCamel: String?
public var capitalCamel: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public struct Cat: Codable {
public struct Cat: Codable, Hashable {

public var className: String
public var color: String? = "red"
Expand Down
Loading