Skip to content

Commit

Permalink
fix(specs): results in getObjects is required (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4024

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Oct 23, 2024
1 parent 45bdb3e commit 54499db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Search/Models/GetObjectsResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import Foundation

public struct GetObjectsResponse<T: Codable>: Codable, JSONEncodable {
/// Retrieved records.
public var results: [T]?
public var results: [T]

public init(results: [T]? = nil) {
public init(results: [T]) {
self.results = results
}

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

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(self.results, forKey: .results)
try container.encode(self.results, forKey: .results)
}
}

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

extension GetObjectsResponse: Hashable where T: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.results?.hashValue)
hasher.combine(self.results.hashValue)
}
}

0 comments on commit 54499db

Please sign in to comment.