From 7b8f07cbb3a7eff9445f084722fbbd4cb6fa7837 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Thu, 6 Jun 2024 15:42:46 +0200 Subject: [PATCH 1/2] fix(data_schema.dart): fix deserialization of required field --- lib/src/core/definitions/data_schema.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/core/definitions/data_schema.dart b/lib/src/core/definitions/data_schema.dart index 9ed6f4bc..ca9cc0b7 100644 --- a/lib/src/core/definitions/data_schema.dart +++ b/lib/src/core/definitions/data_schema.dart @@ -92,7 +92,8 @@ class DataSchema implements Serializable { json.parseDataSchemaArrayField("items", prefixMapping, parsedFields); final minItems = json.parseField("minItems", parsedFields); final maxItems = json.parseField("maxItems", parsedFields); - final required = json.parseField>("required", parsedFields); + final required = + json.parseArrayField("required", parsedFields: parsedFields); final minLength = json.parseField("minLength", parsedFields); final maxLength = json.parseField("maxLength", parsedFields); final pattern = json.parseField("pattern", parsedFields); From 4a67d2d9edc838157119a67be5d9945e7f01e5cf Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Thu, 6 Jun 2024 15:43:21 +0200 Subject: [PATCH 2/2] fix(json_parser.dart): fix parseDataSchemaArrayField method --- lib/src/core/definitions/extensions/json_parser.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/core/definitions/extensions/json_parser.dart b/lib/src/core/definitions/extensions/json_parser.dart index 1adb3f61..94b338c7 100644 --- a/lib/src/core/definitions/extensions/json_parser.dart +++ b/lib/src/core/definitions/extensions/json_parser.dart @@ -296,7 +296,7 @@ extension ParseField on Map { Set? parsedFields, ) { final fieldValue = - parseField>>(name, parsedFields); + parseArrayField>(name, parsedFields: parsedFields); return fieldValue ?.map((e) => DataSchema.fromJson(e, prefixMapping))