This commit is contained in:
nlohmann committed 2026-10-12 07:35:31 +00:00
1 parent 79119509a9
commit 22fba27145
555 files changed
+17342 -1394

No files matched your search

+9 -5
View File
@@ -143,7 +143,7 @@ See [documentation of `JSON_DIAGNOSTICS`](https://json.nlohmann.me/api/macros/js
## Parse errors
The library throws this exception when a parse error occurs. Parse errors can occur during the deserialization of JSON text, CBOR, MessagePack, as well as when using JSON Patch.
The library throws this exception when a parse error occurs. Parse errors can occur during the deserialization of JSON text or of one of the binary formats (BJData, BON8, BSON, CBOR, MessagePack, UBJSON), as well as when using JSON Patch.
Exceptions have ids 1xx.
@@ -245,7 +245,7 @@ Invalid UTF-8 byte:
Tip
- Make sure the input is correctly read. Try to write the input to standard output to check if, for instance, the input file was successfully opened.
- Paste the input to a JSON validator like <http://jsonlint.com> or a tool like [jq](https://stedolan.github.io/jq/).
- Paste the input to a JSON validator like <https://jsonlint.com> or a tool like [jq](https://jqlang.github.io/jq/).
### json.exception.parse_error.102
@@ -335,7 +335,7 @@ Example message
### json.exception.parse_error.109
A JSON Pointer array index must be a number.
A JSON Pointer array index must be a number. This exception is thrown for an array index that does not begin with a digit, except for `-` and the empty reference token, which throw [`out_of_range.404`](#jsonexceptionout_of_range404) where they cannot be resolved.
Example messages
@@ -347,6 +347,10 @@ Example messages
[json.exception.parse_error.109] parse error: array index '+1' is not a number
```
Note
Before version 3.13.0 unreleased, a one-character array index that is not a digit (e.g., `x`) threw [`out_of_range.404`](#jsonexceptionout_of_range404) instead.
### json.exception.parse_error.110
When parsing a [binary format](https://json.nlohmann.me/features/binary_formats/index.md), the byte vector ends before the complete value has been read.
@@ -912,7 +916,7 @@ Example message
### json.exception.type_error.321
A discarded value (one created by [`parse()`](https://json.nlohmann.me/api/basic_json/parse/index.md) with a callback that returns `false` for the value, or by default-constructing a [`basic_json`](https://json.nlohmann.me/api/basic_json/index.md) with [`value_t::discarded`](https://json.nlohmann.me/api/basic_json/value_t/index.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, or BSON.
A discarded value (one created by [`parse()`](https://json.nlohmann.me/api/basic_json/parse/index.md) with a callback that returns `false` for the value, or by default-constructing a [`basic_json`](https://json.nlohmann.me/api/basic_json/index.md) with [`value_t::discarded`](https://json.nlohmann.me/api/basic_json/value_t/index.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.
Example message
@@ -994,7 +998,7 @@ key 'foo' not found
### json.exception.out_of_range.404
A reference token in a JSON Pointer could not be resolved.
A reference token in a JSON Pointer could not be resolved, for instance an array index that begins with a digit but contains other characters (e.g., `1a`), or `-` where it cannot be used.
Example message