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
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml
None => returnBox::new(future::err(ApiError(String::from("Required response header X-Rate-Limit for response 200 was not found."))))asBox<Future<Item=_,Error=_>>,
None => returnBox::new(future::err(ApiError(String::from("Required response header X-Expires-After for response 200 was not found."))))asBox<Future<Item=_,Error=_>>,
2539
+
};
2540
+
let body = response.body();
2541
+
Box::new(
2542
+
2543
+
body
2544
+
.concat2()
2545
+
.map_err(|e| ApiError(format!("Failed to read response: {}", e)))
2546
+
.and_then(|body| str::from_utf8(&body)
2547
+
.map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))
2548
+
.and_then(|body|
2549
+
2550
+
// ToDo: this will move to swagger-rs and become a standard From conversion trait
2551
+
// once https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream
2552
+
serde_xml_rs::from_str::<String>(body)
2553
+
.map_err(|e| ApiError(format!("Response body did not match the schema: {}", e)))
0 commit comments