-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ensure nested field support * Remove dumps * Resolve linting issues
- Loading branch information
Showing
2 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Tests/MeiliSearchIntegrationTests/Support/NestedBook.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
public struct NestedBook: Codable, Equatable { | ||
let id: Int | ||
let title: String | ||
let info: InfoNested | ||
let genres: [String]? | ||
let formatted: FormattedNestedBook? | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id | ||
case title | ||
case info | ||
case genres | ||
case formatted = "_formatted" | ||
} | ||
|
||
init(id: Int, title: String, info: InfoNested, genres: [String] = [], formatted: FormattedNestedBook? = nil) { | ||
self.id = id | ||
self.title = title | ||
self.info = info | ||
self.genres = genres | ||
self.formatted = formatted | ||
} | ||
} | ||
|
||
public struct InfoNested: Codable, Equatable { | ||
let comment: String | ||
let reviewNb: Int | ||
} | ||
|
||
public struct FormattedNestedBook: Codable, Equatable { | ||
let id: String | ||
let title: String | ||
let info: InfoNested | ||
|
||
init(id: String, title: String, info: InfoNested) { | ||
self.id = id | ||
self.title = title | ||
self.info = info | ||
} | ||
} |