Skip to content

Commit 2aa5c93

Browse files
authored
fix: a more complete implementation of schema generation (#1550)
- parse out the default value from ctor param default - exclude getter-only properties - properly exclude properties not set via constructor from required set - correctly include required nullable ctor params in required set Fixes #1549
1 parent d5ab4bd commit 2aa5c93

14 files changed

Lines changed: 906 additions & 432 deletions

json_serializable/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 6.13.0-wip
22

3+
- Fix schema generation for many different types of fields.
4+
([#1549](https://github.com/google/json_serializable.dart/issues/1549))
35
- Support `JsonSerializable.dateTimeUtc` configuration option.
46
([#1371](https://github.com/google/json_serializable.dart/issues/1371))
57
- Remove `json_schema` from `dependencies` (it is only used in tests).

json_serializable/lib/src/field_helpers.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,4 @@ List<FieldElement> createSortedFieldSet(ClassElement element) {
107107
return fields.map((fs) => fs.field).toList(growable: false);
108108
}
109109

110-
const _dartCoreObjectChecker = TypeChecker.typeNamed(
111-
Object,
112-
inPackage: 'core',
113-
inSdk: true,
114-
);
110+
const _dartCoreObjectChecker = TypeChecker.fromUrl('dart:core#Object');

json_serializable/lib/src/json_schema_generator.dart

Lines changed: 0 additions & 261 deletions
This file was deleted.

0 commit comments

Comments
 (0)