Skip to content

Commit aca6b11

Browse files
committed
Enhance apispec so it output the given response when failing
1 parent d4ac66d commit aca6b11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mithril-common/src/test_utils/apispec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ impl<'a> APISpec<'a> {
3333
.path(path)
3434
.content_type(content_type)
3535
.validate_request(request_body)
36-
.map_err(|e| panic!("OpenAPI invalid request in {spec_file}, reason: {e}"))
36+
.map_err(|e| panic!("OpenAPI invalid request in {spec_file}, reason: {e}\nresponse: {response:#?}"))
3737
.unwrap()
3838
.validate_response(response)
39-
.map_err(|e| panic!("OpenAPI invalid response in {spec_file}, reason: {e}"))
39+
.map_err(|e| panic!("OpenAPI invalid response in {spec_file}, reason: {e}\nresponse: {response:#?}"))
4040
.unwrap();
4141
}
4242
}

0 commit comments

Comments
 (0)