You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I'm not sure the regex being used is entirely correct here:
" tests['Article\\'s \"createdAt\" property is an ISO 8601 timestamp'] = /^\\d{4,}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d.\\d+(?:[+-][0-2]\\d:[0-5]\\d|Z)$/.test(article.createdAt);",
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:
abonander
changed the title
[Bug]: Postman collection has a bug in the regex for matching ISO-8601 dates
[Bug]: Regex in Postman collection rejects valid ISO-8601 timestamps
Dec 14, 2021
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:
realworld/api/Conduit.postman_collection.json
Line 332 in 6e73f5e
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:The text was updated successfully, but these errors were encountered: