Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

getJsonObject

Stringify.getJsonObject
fn getJsonObject(allocator: std.mem.Allocator) !std.json.Value

File

lib/std/json/Stringify.zig:772

Code

fn getJsonObject(allocator: std.mem.Allocator) !std.json.Value {
    var v: std.json.Value = .{ .object = .empty };
    try v.object.put(allocator, "one", std.json.Value{ .integer = @as(i64, @intCast(1)) });
    try v.object.put(allocator, "two", std.json.Value{ .float = 2.0 });
    return v;
}