Skip to content

Commit 28b8859

Browse files
authored
UnrecognizedKeysException: small improvements to message value (#219)
...and doc comments Prepare to release json_annotation v0.2.7+1
1 parent c673282 commit 28b8859

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

json_annotation/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.2.7+1
2+
3+
* Small improvement to `UnrecognizedKeysException.message` output and
4+
documentation comments.
5+
16
## 0.2.7
27

38
* Added `JsonSerializable.disallowUnrecognizedKeys`.

json_annotation/lib/src/allowed_keys_helpers.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void $checkAllowedKeys(Map map, Iterable<String> allowedKeys) {
1515
}
1616
}
1717

18-
/// Exception thrown if there is an unrecognized key in a json map that was
18+
/// Exception thrown if there are unrecognized keys in a JSON map that was
1919
/// provided during deserialization.
2020
class UnrecognizedKeysException implements Exception {
2121
/// The allowed keys for [map].
@@ -24,12 +24,12 @@ class UnrecognizedKeysException implements Exception {
2424
/// The keys from [map] that were unrecognized.
2525
final List<String> unrecognizedKeys;
2626

27-
/// The source [Map] that the key was found in.
27+
/// The source [Map] that the unrecognized keys were found in.
2828
final Map map;
2929

3030
/// A human-readable message corresponding to the error.
3131
String get message =>
32-
'Unrecognized keys [${unrecognizedKeys.join(', ')}], supported keys are '
32+
'Unrecognized keys: [${unrecognizedKeys.join(', ')}]; supported keys: '
3333
'[${allowedKeys.join(', ')}]';
3434

3535
UnrecognizedKeysException(this.unrecognizedKeys, this.map, this.allowedKeys);

json_annotation/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: json_annotation
2-
version: 0.2.7
2+
version: 0.2.7+1
33
description: >-
44
Classes and helper functions that support JSON code generation via the
55
`json_serializable` package.

0 commit comments

Comments
 (0)