Hi everyone,
I’m writing a test in Postman and encountering an AssertionError. I want to validate that my request URL follows the pattern /books/{id}
, where {id}
is a UUID.
Assertion Error:
[checkout a book] path is set to /books/:id | AssertionError: expected '{{baseUrl}}/books/{{id}}' to match /\/books\/:id$/
Variables:
baseUrl
:https://library-api.postmanlabs.com
id
:9d6dde43-8fdc-4b71-84b3-18507398d92f
Constructed URL:
{{baseUrl}}/books/{{id}}
The URL resolves correctly when I send the request, but my test assertion to match the URL pattern fails. I suspect my regex is incorrect for a UUID. Could someone help me adjust my regex to properly match a UUID in the URL?
How should I adjust my regex to correctly match the UUID format?
Thanks for your help!