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 sort to Single Document Response #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.33.0"),

.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.7")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand All @@ -29,6 +31,8 @@ let package = Package(
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),

.product(name: "AnyCodable", package: "AnyCodable")
]),
.testTarget(
name: "ElasticsearchNIOClientTests",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import Foundation
import AnyCodable

public struct ESGetSingleDocumentResponse<Document: Decodable>: Decodable {
public let id: String
public let index: String
public let version: Int?
public let source: Document
public let sort: AnyCodable?

enum CodingKeys: String, CodingKey {
case id = "_id"
case index = "_index"
case version = "_version"
case source = "_source"
case sort
}
}