Skip to content

Commit 5b28d33

Browse files
authored
Actualize lenient mode documentation (#2568)
Because after #2440 quoted boolean values are allowed by default, and quoted numbers were allowed even before that.
1 parent ab64422 commit 5b28d33

File tree

2 files changed

+3
-4
lines changed
  • docs
  • formats/json/commonMain/src/kotlinx/serialization/json

2 files changed

+3
-4
lines changed

docs/json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ It gives the following nice result:
9595
### Lenient parsing
9696

9797
By default, [Json] parser enforces various JSON restrictions to be as specification-compliant as possible
98-
(see [RFC-4627]). Particularly, keys must be quoted, while literals must be unquoted. Those restrictions can be relaxed with
98+
(see [RFC-4627]). Particularly, keys and string literals must be quoted. Those restrictions can be relaxed with
9999
the [isLenient][JsonBuilder.isLenient] property. With `isLenient = true`, you can parse quite freely-formatted data:
100100

101101
```kotlin

formats/json/commonMain/src/kotlinx/serialization/json/Json.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,10 @@ public class JsonBuilder internal constructor(json: Json) {
254254

255255
/**
256256
* Removes JSON specification restriction (RFC-4627) and makes parser
257-
* more liberal to the malformed input. In lenient mode quoted boolean literals,
258-
* and unquoted string literals are allowed.
257+
* more liberal to the malformed input. In lenient mode, unquoted JSON keys and string values are allowed.
259258
*
260259
* Its relaxations can be expanded in the future, so that lenient parser becomes even more
261-
* permissive to invalid value in the input, replacing them with defaults.
260+
* permissive to invalid values in the input.
262261
*
263262
* `false` by default.
264263
*/

0 commit comments

Comments
 (0)