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
Prism-generated dynamic mock responses of type: string and format: duration randomly produce non-valid duration strings such as "P725387655M58009976655DT" and "P", resulting in errors. Rerunning the same GET call produces errors unpredictably.
Expected Behavior
A dynamic response of format: duration should always pass validation.
Steps to Reproduce
Snippet from my valid API definition for GET response:
[VALIDATOR] ✖ error Violation: response.body.max Response body property max must match format "duration"
3. Prism-mocked response body and error (second run, same query parameters):
[VALIDATOR] ✖ error Violation: response.body.max Response body property max must match format "duration"
[VALIDATOR] ✖ error Violation: response.body.average Response body property average must match format "duration"
[VALIDATOR] ✖ error Violation: response.body.total Response body property total must match format "duration"
Environment
Version used: 5.12.0
Environment name and version (e.g. Chrome 39, node.js 5.4): Node 22.7.0
Operating System and version (desktop or mobile): macOS Sonoma
The text was updated successfully, but these errors were encountered:
hxlnt
changed the title
Prism mocks of strings with format: duration are sometimes "P," causing validation errors at random
Prism mocks of strings with format: duration are sometimes malformed, causing validation errors at random
Jan 13, 2025
Current Behavior
Prism-generated dynamic mock responses of
type: string
andformat: duration
randomly produce non-valid duration strings such as"P725387655M58009976655DT"
and"P"
, resulting in errors. Rerunning the same GET call produces errors unpredictably.Expected Behavior
A dynamic response of
format: duration
should always pass validation.Steps to Reproduce
[VALIDATOR] ✖ error Violation: response.body.max Response body property max must match format "duration"
3. Prism-mocked response body and error (second run, same query parameters):
[VALIDATOR] ✖ error Violation: response.body.max Response body property max must match format "duration"
[VALIDATOR] ✖ error Violation: response.body.average Response body property average must match format "duration"
[VALIDATOR] ✖ error Violation: response.body.total Response body property total must match format "duration"
Environment
The text was updated successfully, but these errors were encountered: