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-25 20:05:35 +01:00
1 parent 225b09ded2
commit d97ea0b163
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
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.
## 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
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:
```
[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
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.