Skip to content

Commit

Permalink
Merge pull request #181 from eclipse-thingweb/fix-deserialization
Browse files Browse the repository at this point in the history
Fix DataSchema-related deserialization
  • Loading branch information
JKRhb authored Jun 7, 2024
2 parents 034aca5 + 4a67d2d commit 0191f0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/src/core/definitions/data_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class DataSchema implements Serializable {
json.parseDataSchemaArrayField("items", prefixMapping, parsedFields);
final minItems = json.parseField<int>("minItems", parsedFields);
final maxItems = json.parseField<int>("maxItems", parsedFields);
final required = json.parseField<List<String>>("required", parsedFields);
final required =
json.parseArrayField<String>("required", parsedFields: parsedFields);
final minLength = json.parseField<int>("minLength", parsedFields);
final maxLength = json.parseField<int>("maxLength", parsedFields);
final pattern = json.parseField<String>("pattern", parsedFields);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/definitions/extensions/json_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ extension ParseField on Map<String, dynamic> {
Set<String>? parsedFields,
) {
final fieldValue =
parseField<List<Map<String, dynamic>>>(name, parsedFields);
parseArrayField<Map<String, dynamic>>(name, parsedFields: parsedFields);

return fieldValue
?.map((e) => DataSchema.fromJson(e, prefixMapping))
Expand Down

0 comments on commit 0191f0d

Please sign in to comment.