Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos in documentation #3140

Merged
merged 2 commits into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/mkdocs/docs/api/basic_json/binary_t.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type `#!cpp binary_t*` must be dereferenced.
- MessagePack
- If a subtype is given and the binary array contains exactly 1, 2, 4, 8, or 16 elements, the fixext family (fixext1,
fixext2, fixext4, fixext8) is used. For other sizes, the ext family (ext8, ext16, ext32) is used. The subtype is
then added as singed 8-bit integer.
then added as signed 8-bit integer.
- If no subtype is given, the bin family (bin8, bin16, bin32) is used.

- BSON
Expand Down
6 changes: 3 additions & 3 deletions doc/mkdocs/docs/api/basic_json/erase.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ void erase(const size_type idx);
- Throws [`invalid_iterator.205`](../../home/exceptions.md#jsonexceptioninvalid_iterator205) if called on a
primitive type with invalid iterator (i.e., any iterator which is not `begin()`); example: `"iterator out of
range"`
2. The function can throw thw following exceptions:
2. The function can throw the following exceptions:
- Throws [`type_error.307`](../../home/exceptions.md#jsonexceptiontype_error307) if called on a `null` value;
example: `"cannot use erase() with null"`
- Throws [`invalid_iterator.203`](../../home/exceptions.md#jsonexceptioninvalid_iterator203) if called on iterators
which does not belong to the current JSON value; example: `"iterators do not fit current value"`
- Throws [`invalid_iterator.204`](../../home/exceptions.md#jsonexceptioninvalid_iterator204) if called on a
primitive type with invalid iterators (i.e., if `first != begin()` and `last != end()`); example: `"iterators out
of range"`
3. The function can throw thw following exceptions:
3. The function can throw the following exceptions:
- Throws [`type_error.307`](../../home/exceptions.md#jsonexceptiontype_error307) when called on a type other than
JSON object; example: `"cannot use erase() with null"`
4. The function can throw thw following exceptions:
4. The function can throw the following exceptions:
- Throws [`type_error.307`](../../home/exceptions.md#jsonexceptiontype_error307) when called on a type other than
JSON object; example: `"cannot use erase() with null"`
- Throws [`out_of_range.401`](../../home/exceptions.md#jsonexceptionout_of_range401) when `idx >= size()`; example:
Expand Down
8 changes: 4 additions & 4 deletions doc/mkdocs/docs/api/basic_json/insert.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ void insert(const_iterator first, const_iterator last);
arrays; example: `"cannot use insert() with string"`
- Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an
iterator which does not belong to the current JSON value; example: `"iterator does not fit current value"`
2. The function can throw thw following exceptions:
2. The function can throw the following exceptions:
- Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than
arrays; example: `"cannot use insert() with string"`
- Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an
iterator which does not belong to the current JSON value; example: `"iterator does not fit current value"`
3. The function can throw thw following exceptions:
3. The function can throw the following exceptions:
- Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than
arrays; example: `"cannot use insert() with string"`
- Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an
Expand All @@ -73,12 +73,12 @@ void insert(const_iterator first, const_iterator last);
do not belong to the same JSON value; example: `"iterators do not fit"`
- Throws [`invalid_iterator.211`](../../home/exceptions.md#jsonexceptioninvalid_iterator211) if `first` or `last`
are iterators into container for which insert is called; example: `"passed iterators may not belong to container"`
4. The function can throw thw following exceptions:
4. The function can throw the following exceptions:
- Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than
arrays; example: `"cannot use insert() with string"`
- Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an
iterator which does not belong to the current JSON value; example: `"iterator does not fit current value"`
5. The function can throw thw following exceptions:
5. The function can throw the following exceptions:
- Throws [`type_error.309`](../../home/exceptions.md#jsonexceptiontype_error309) if called on JSON values other than
objects; example: `"cannot use insert() with string"`
- Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an
Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs/docs/api/basic_json/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ When iterating over an array, `key()` will return the index of the element as st

!!! warning

Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exeeds the iteration. See
Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exceeds the iteration. See
<https://github.com/nlohmann/json/issues/2040> for more information.

## Example
Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs/docs/api/basic_json/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function.
1. The function can throw the following exceptions:
- Throws [`type_error.312`](../../home/exceptions.md#jsonexceptiontype_error312) if called on JSON values other than
objects; example: `"cannot use update() with string"`
2. The function can throw thw following exceptions:
2. The function can throw the following exceptions:
- Throws [`type_error.312`](../../home/exceptions.md#jsonexceptiontype_error312) if called on JSON values other than
objects; example: `"cannot use update() with string"`
- Throws [`invalid_iterator.202`](../../home/exceptions.md#jsonexceptioninvalid_iterator202) if called on an
Expand Down
4 changes: 2 additions & 2 deletions doc/mkdocs/docs/api/basic_json/value.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ changes to any JSON value.

## Exceptions

1. The function can throw thw following exceptions:
1. The function can throw the following exceptions:
- Throws [`type_error.302`](../../home/exceptions.md#jsonexceptiontype_error302) if `default_value` does not match
the type of the value at `key`
- Throws [`type_error.306`](../../home/exceptions.md#jsonexceptiontype_error306) if the JSON value is not an object;
in that case, using `value()` with a key makes no sense.
2. The function can throw thw following exceptions:
2. The function can throw the following exceptions:
- Throws [`type_error.302`](../../home/exceptions.md#jsonexceptiontype_error302) if `default_value` does not match
the type of the value at `ptr`
- Throws [`type_error.306`](../../home/exceptions.md#jsonexceptiontype_error306) if the JSON value is not an object;
Expand Down
4 changes: 2 additions & 2 deletions doc/mkdocs/docs/features/binary_values.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ JSON does not have a binary type, and this library does not introduce a new type

### MessagePack

[MessagePack](binary_formats/messagepack.md) supports binary values and subtypes. If a subtype is given, the ext family is used. The library will choose the smallest representation among fixext1, fixext2, fixext4, fixext8, ext8, ext16, and ext32. The subtype is then added as singed 8-bit integer.
[MessagePack](binary_formats/messagepack.md) supports binary values and subtypes. If a subtype is given, the ext family is used. The library will choose the smallest representation among fixext1, fixext2, fixext4, fixext8, ext8, ext16, and ext32. The subtype is then added as signed 8-bit integer.

If no subtype is given, the bin family (bin8, bin16, bin32) is used.

Expand Down Expand Up @@ -282,7 +282,7 @@ If no subtype is given, the bin family (bin8, bin16, bin32) is used.
0x23 0x69 0x01 // '#' i 1 number of object elements
0x69 0x06 // i 6 (length of the key)
0x62 0x69 0x6E 0x61 0x72 0x79 // "binary"
0x24 0x55 // '$' 'U' type of the array elements: unsinged integers
0x24 0x55 // '$' 'U' type of the array elements: unsigned integers
0x23 0x69 0x04 // '#' i 4 number of array elements
0xCA 0xFE 0xBA 0xBE // content
```
Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs/docs/features/iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ for (auto& [key, val] : j_object.items())

!!! warning

Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exeeds the iteration. See <https://github.com/nlohmann/json/issues/2040> for more information.
Using `items()` on temporary objects is dangerous. Make sure the object's lifetime exceeds the iteration. See <https://github.com/nlohmann/json/issues/2040> for more information.

### Reverse iteration order

Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs/docs/features/types/number_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ That is, `-0` is stored as a signed integer, but the serialization does not repr
- The serialization can be in scientific notation even if the input is not: `#!c 0.0000972439793401814` will be
serialized as `#!c 9.72439793401814e-05`. The reverse can also be true: `#!c 12345E-5` will be serialized as
`#!c 0.12345`.
- Conversions from `#!c float` to `#!c double` can also introduce rouding errors:
- Conversions from `#!c float` to `#!c double` can also introduce rounding errors:
```cpp
float f = 0.3;
json j = f;
Expand Down
2 changes: 1 addition & 1 deletion doc/mkdocs/docs/home/exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ This error indicates a syntax error while deserializing a JSON text. The error m

!!! 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 openened.
- 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/).

### json.exception.parse_error.102
Expand Down
6 changes: 3 additions & 3 deletions doc/mkdocs/docs/home/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ This release further fixes several bugs in the library. All changes are backward
- allow compare user-defined string types (#1130)
- better support for algorithms using iterators from `items()` (#1045, #1134)
- added parameter to avoid compilation error with MSVC 2015 debug builds (#1114)
- re-added accidentially skipped unit tests (#1176)
- re-added accidentally skipped unit tests (#1176)
- fixed MSVC issue with `std::swap` (#1168)

### :zap: Improvements
Expand Down Expand Up @@ -1008,7 +1008,7 @@ This release fixes a few bugs in the JSON parser found in the [Parsing JSON is a
This release fixes the semantics of `operator[]` for JSON Pointers (see below). This fix is backwards compatible.

### Changes
- **`operator[]` for JSON Pointers** now behaves like the other versions of `operator[]` and transforms `null` values into objects or arrays if required. This allows to created nested structues like `j["/foo/bar/2"] = 17` (yielding `{"foo": "bar": [null, null, 17]}`) without problems.
- **`operator[]` for JSON Pointers** now behaves like the other versions of `operator[]` and transforms `null` values into objects or arrays if required. This allows to created nested structures like `j["/foo/bar/2"] = 17` (yielding `{"foo": "bar": [null, null, 17]}`) without problems.
- overworked a helper SFINAE function
- fixed some documentation issues
- fixed the CMake files to allow to run the test suite outside the main project directory
Expand Down Expand Up @@ -1093,7 +1093,7 @@ This release combines a lot of small fixes and improvements. The release is back
### Changes
- The **parser** has been overworked, and a lot of small issues have been fixed:
- Improved parser performance by avoiding recursion and using move semantics for the return value.
- Unescaped control charaters `\x10`-`\x1f` are not accepted any more.
- Unescaped control characters `\x10`-`\x1f` are not accepted any more.
- Fixed a bug in the parser when reading from an input stream.
- Improved test case coverage for UTF-8 parsing: now, all valid Unicode code points are tested both escaped and unescaped.
- The precision of output streams is now preserved by the parser.
Expand Down
2 changes: 1 addition & 1 deletion test/src/unit-regression2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ TEST_CASE("regression tests 2")
auto val2 = j.value("y", defval);
}

SECTION("issue #2293 - eof doesnt cause parsing to stop")
SECTION("issue #2293 - eof doesn't cause parsing to stop")
{
std::vector<uint8_t> data =
{
Expand Down