Skip to content

Commit

Permalink
fixup! feat!: improve deserialization logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jun 2, 2024
1 parent 9580c76 commit eadf287
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/core/definitions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -660,4 +660,22 @@ void main() {
throwsA(isA<FormatException>()),
);
});

test("Should throw FormatExceptions for wrong array field types", () {
final invalidThingDescription = {
"@context": ["https://www.w3.org/2022/wot/td/v1.1"],
"title": "Thingweb WoT Thing",
"security": 42,
"securityDefinitions": {
"nosec_sc": {
"scheme": "nosec",
},
},
};

expect(
() => ThingDescription.fromJson(invalidThingDescription),
throwsA(isA<FormatException>()),
);
});
}

0 comments on commit eadf287

Please sign in to comment.