Skip to content

Commit 54499db

Browse files
fix(specs): results in getObjects is required (generated)
algolia/api-clients-automation#4024 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 45bdb3e commit 54499db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/Search/Models/GetObjectsResponse.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import Foundation
88

99
public struct GetObjectsResponse<T: Codable>: Codable, JSONEncodable {
1010
/// Retrieved records.
11-
public var results: [T]?
11+
public var results: [T]
1212

13-
public init(results: [T]? = nil) {
13+
public init(results: [T]) {
1414
self.results = results
1515
}
1616

@@ -22,7 +22,7 @@ public struct GetObjectsResponse<T: Codable>: Codable, JSONEncodable {
2222

2323
public func encode(to encoder: Encoder) throws {
2424
var container = encoder.container(keyedBy: CodingKeys.self)
25-
try container.encodeIfPresent(self.results, forKey: .results)
25+
try container.encode(self.results, forKey: .results)
2626
}
2727
}
2828

@@ -34,6 +34,6 @@ extension GetObjectsResponse: Equatable where T: Equatable {
3434

3535
extension GetObjectsResponse: Hashable where T: Hashable {
3636
public func hash(into hasher: inout Hasher) {
37-
hasher.combine(self.results?.hashValue)
37+
hasher.combine(self.results.hashValue)
3838
}
3939
}

0 commit comments

Comments
 (0)