Skip to content

Commit d0dbc84

Browse files
Added documentation of the serialize_binary parameter
1 parent 38f8e86 commit d0dbc84

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

include/nlohmann/json.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,11 @@ class basic_json
22002200
possible values: `strict` (throws and exception in case a decoding error
22012201
occurs; default), `replace` (replace invalid UTF-8 sequences with U+FFFD),
22022202
and `ignore` (ignore invalid UTF-8 sequences during serialization).
2203+
@param[in] serialize_binary Whether or not to allow serialization of binary
2204+
types to JSON. Because binary types are non-standard, this will produce
2205+
non-conformant JSON, and is disabled by default. This flag is primarily
2206+
useful for debugging. Will output the binary value as a list of 8-bit
2207+
numbers prefixed by "b" (e.g. "bindata" = b[3, 0, 42, 255]).
22032208
22042209
@return string containing the serialization of the JSON value
22052210

single_include/nlohmann/json.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17733,6 +17733,11 @@ class basic_json
1773317733
possible values: `strict` (throws and exception in case a decoding error
1773417734
occurs; default), `replace` (replace invalid UTF-8 sequences with U+FFFD),
1773517735
and `ignore` (ignore invalid UTF-8 sequences during serialization).
17736+
@param[in] serialize_binary Whether or not to allow serialization of binary
17737+
types to JSON. Because binary types are non-standard, this will produce
17738+
non-conformant JSON, and is disabled by default. This flag is primarily
17739+
useful for debugging. Will output the binary value as a list of 8-bit
17740+
numbers prefixed by "b" (e.g. "bindata" = b[3, 0, 42, 255]).
1773617741

1773717742
@return string containing the serialization of the JSON value
1773817743

0 commit comments

Comments
 (0)