Skip to content

Commit

Permalink
fixup! feat!: implement proper serialization logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Jun 4, 2024
1 parent 2245292 commit b06dec7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/src/core/definitions/thing_description.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,14 @@ class ThingDescription {
result["version"] = version.toJson();
}

final created = this.created;
if (created != null) {
result["created"] = created.toString();
result["created"] = created.toIso8601String();
}

final modified = this.modified;
if (modified != null) {
result["modified"] = modified.toString();
result["modified"] = modified.toIso8601String();
}

if (support != null) {
Expand Down
6 changes: 4 additions & 2 deletions test/core/definitions/serialization_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ void main() {
"version": {
"instance": "1.0.0",
},
"created": "2024-05-25 00:00:00.000",
"modified": "2024-05-25 00:00:00.000",
// TODO: Should fields like these be able to be "roundtripped"?
// I.e., getting the same result back that was put in?
"created": "2024-05-25T00:00:00.000",
"modified": "2024-05-25T00:00:00.000",
"support": "https://example.org",
"base": "https://example.org",
"id": "urn:uuid:5edfed77-fc4e-46d4-a550-ef7f07592fbd",
Expand Down

0 comments on commit b06dec7

Please sign in to comment.