diff --git a/lib/src/core/definitions/thing_description.dart b/lib/src/core/definitions/thing_description.dart index fd786014..b88553ea 100644 --- a/lib/src/core/definitions/thing_description.dart +++ b/lib/src/core/definitions/thing_description.dart @@ -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) { diff --git a/test/core/definitions/serialization_test.dart b/test/core/definitions/serialization_test.dart index 3917e980..0fa7cdae 100644 --- a/test/core/definitions/serialization_test.dart +++ b/test/core/definitions/serialization_test.dart @@ -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",