docs: use the Oxford comma, drop discarded-value remarks

Add the serial comma in a list added by this PR and remove the BSON
example of type_error.321 (with the type_error.317 remark) so the docs do
not mention discarded values for BSON; restore the original singular
heading of that section. No tables were changed by this PR.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-26 06:53:09 +01:00
1 parent e359852b76
commit d19e030bf1
2 files changed
+2 -8

No files matched your search

@@ -6,7 +6,7 @@ class byte_container_with_subtype : public BinaryType;
``` ```
This type extends the template parameter `BinaryType` provided to [`basic_json`](../basic_json/index.md) with a subtype This type extends the template parameter `BinaryType` provided to [`basic_json`](../basic_json/index.md) with a subtype
used by BSON, CBOR and MessagePack. This type exists so that the user does not have to specify a type themselves with a used by BSON, CBOR, and MessagePack. This type exists so that the user does not have to specify a type themselves with a
specific naming scheme in order to override the binary type. specific naming scheme in order to override the binary type.
## Template parameters ## Template parameters
+1 -7
View File
@@ -906,19 +906,13 @@ value, or by default-constructing a [`basic_json`](../api/basic_json/index.md) w
[`value_t::discarded`](../api/basic_json/value_t.md)) was passed to a binary serialization function, either directly or [`value_t::discarded`](../api/basic_json/value_t.md)) was passed to a binary serialization function, either directly or
nested in an array or object. There is no way to represent a discarded value in CBOR, MessagePack, UBJSON, BJData, BSON, or BON8. nested in an array or object. There is no way to represent a discarded value in CBOR, MessagePack, UBJSON, BJData, BSON, or BON8.
!!! failure "Example messages" !!! failure "Example message"
Serializing `#!json [1, 2]` to CBOR, where the second element was discarded by a parser callback: Serializing `#!json [1, 2]` to CBOR, where the second element was discarded by a parser callback:
``` ```
[json.exception.type_error.321] cannot serialize discarded value to CBOR [json.exception.type_error.321] cannot serialize discarded value to CBOR
``` ```
Serializing an object with a discarded member to BSON (a discarded value at the top level is reported as
[`type_error.317`](#jsonexceptiontype_error317) instead, since BSON requires an object there):
```
[json.exception.type_error.321] cannot serialize discarded value to BSON
```
## Out of range ## Out of range
This exception is thrown in case a library function is called on an input parameter that exceeds the expected range, for instance, in the case of array indices or nonexisting object keys. This exception is thrown in case a library function is called on an input parameter that exceeds the expected range, for instance, in the case of array indices or nonexisting object keys.