Extend value to arrays when using JSON pointers (#5223)

*  extend value to arrays when using JSON pointers

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 💚 avoid exceptions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 💚 avoid exceptions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-07-02 06:35:35 +02:00
committed by GitHub
parent 730b57775d
commit ca49ab6123
7 changed files with 271 additions and 53 deletions
@@ -33,7 +33,8 @@ you want to access and a default value in case there is no value stored with tha
!!! failure "Exceptions"
- `value` can only be used with objects. For other types, a [`basic_json::type_error`](../../home/exceptions.md#jsonexceptiontype_error306) is thrown.
- With string keys, `value` can only be used with objects. For other types, a [`basic_json::type_error`](../../home/exceptions.md#jsonexceptiontype_error306) is thrown.
- With JSON Pointers, `value` can be used with both objects and arrays. For other types (null, boolean, number, string), a [`basic_json::type_error`](../../home/exceptions.md#jsonexceptiontype_error306) is thrown.
!!! warning "Return type"