I'm working on a Rust implementation of the backend spec, and I'm using time 0.2 for timestamps such as the createdAt timestamps of Articles.
The RFC 3339 (subset of ISO 8601) formatter included with time 0.2 produces timestamps like this: 2021-12-14T03:09:36+00:00
This is a valid ISO 8601 timestamp and can be parsed using, e.g. Javascript's Date.parse() just fine, but it gets rejected by the regex used in the Postman collection here:
↳ Create Article
POST http://localhost:8080/api/articles [200 OK, 450B, 15ms]
✓ Response contains "article" property
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
7. Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
8. Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
It appears to require a decimal subsecond segment but matches on the decimal separator using an unescaped . which matches any single character instead of an escaped \. matching a literal dot. If I tweak the regex to fix this and make the subsecond fragment optional, my timestamp passes:
Relevant scope
Other: describe below
Description
I'm working on a Rust implementation of the backend spec, and I'm using
time 0.2
for timestamps such as thecreatedAt
timestamps of Articles.The RFC 3339 (subset of ISO 8601) formatter included with
time 0.2
produces timestamps like this:2021-12-14T03:09:36+00:00
This is a valid ISO 8601 timestamp and can be parsed using, e.g. Javascript's
Date.parse()
just fine, but it gets rejected by the regex used in the Postman collection here:I'm not sure the regex being used is entirely correct here: https://github.com/gothinkster/realworld/blob/6e73f5ee714ae502f5f6ef4aa95bd10fec4ae59b/api/Conduit.postman_collection.json#L332
Unescaped version:
It appears to require a decimal subsecond segment but matches on the decimal separator using an unescaped
.
which matches any single character instead of an escaped\.
matching a literal dot. If I tweak the regex to fix this and make the subsecond fragment optional, my timestamp passes: