📝 update documentation (#4723)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2025-04-05 18:54:35 +02:00
committed by GitHub
parent 11aa5f944d
commit 4424a0fcc1
90 changed files with 377 additions and 339 deletions
+7 -7
View File
@@ -81,7 +81,7 @@ Exceptions in the library are thrown in the local context of the JSON value they
This exception can be hard to debug if storing the value `#!c "12"` and accessing it is further apart.
To create better diagnostics messages, each JSON value needs a pointer to its parent value such that a global context (i.e., a path from the root value to the value that lead to the exception) can be created. That global context is provided as [JSON Pointer](../features/json_pointer.md).
To create better diagnostics messages, each JSON value needs a pointer to its parent value such that a global context (i.e., a path from the root value to the value that led to the exception) can be created. That global context is provided as [JSON Pointer](../features/json_pointer.md).
As this global context comes at the price of storing one additional pointer per JSON value and runtime overhead to maintain the parent relation, extended diagnostics are disabled by default. They can, however, be enabled by defining the preprocessor symbol [`JSON_DIAGNOSTICS`](../api/macros/json_diagnostics.md) to `1` before including `json.hpp`.
@@ -103,7 +103,7 @@ See [documentation of `JSON_DIAGNOSTICS`](../api/macros/json_diagnostics.md) for
## Parse errors
This exception is thrown by the library when a parse error occurs. 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.
@@ -480,7 +480,7 @@ The offset operators (`+`, `-`, `+=`, `-=`) cannot be used on iterators belongin
### json.exception.invalid_iterator.210
The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (`first`, `last`) is invalid.
The iterator range passed to the insert function is not compatible, meaning they do not belong to the same container. Therefore, the range (`first`, `last`) is invalid.
!!! failure "Example message"
@@ -560,7 +560,7 @@ To create an object from an initializer list, the initializer list must consist
### json.exception.type_error.302
During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types.
During implicit or explicit value conversion, the JSON type must be compatible with the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types.
!!! failure "Example messages"
@@ -740,7 +740,7 @@ The `dump()` function only works with UTF-8 encoded strings; that is, if you ass
### json.exception.type_error.317
The dynamic type of the object cannot be represented in the requested serialization format (e.g. a raw `true` or `null` JSON object cannot be serialized to BSON)
The dynamic type of the object cannot be represented in the requested serialization format (e.g., a raw `true` or `null` JSON object cannot be serialized to BSON)
!!! failure "Example messages"
@@ -759,7 +759,7 @@ The dynamic type of the object cannot be represented in the requested serializat
## 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 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.
Exceptions have ids 4xx.
@@ -819,7 +819,7 @@ A reference token in a JSON Pointer could not be resolved.
### json.exception.out_of_range.405
The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value.
The JSON Patch operations 'remove' and 'add' cannot be applied to the root element of the JSON value.
!!! failure "Example message"