Skip to content

Commit 2e8a5fd

Browse files
committed
Fix search response in msgpack
1 parent 426017b commit 2e8a5fd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/server.zig

+8
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,18 @@ const SearchRequestJSON = struct {
113113
const SearchResultJSON = struct {
114114
id: u32,
115115
score: u32,
116+
117+
pub fn msgpackFormat() msgpack.StructFormat {
118+
return .{ .as_map = .{ .key = .{ .field_name_prefix = 1 } } };
119+
}
116120
};
117121

118122
const SearchResultsJSON = struct {
119123
results: []SearchResultJSON,
124+
125+
pub fn msgpackFormat() msgpack.StructFormat {
126+
return .{ .as_map = .{ .key = .{ .field_name_prefix = 1 } } };
127+
}
120128
};
121129

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

0 commit comments

Comments
 (0)