Skip to content

Commit

Permalink
Fix search response in msgpack
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Dec 6, 2024
1 parent 426017b commit 2e8a5fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,18 @@ const SearchRequestJSON = struct {
const SearchResultJSON = struct {
id: u32,
score: u32,

pub fn msgpackFormat() msgpack.StructFormat {
return .{ .as_map = .{ .key = .{ .field_name_prefix = 1 } } };
}
};

const SearchResultsJSON = struct {
results: []SearchResultJSON,

pub fn msgpackFormat() msgpack.StructFormat {
return .{ .as_map = .{ .key = .{ .field_name_prefix = 1 } } };
}
};

fn getId(req: *httpz.Request, res: *httpz.Response, send_body: bool) !?u32 {
Expand Down

0 comments on commit 2e8a5fd

Please sign in to comment.