mirror of
https://github.com/floor-licker/polyfill-rs.git
synced 2026-08-17 14:38:07 +00:00
feat(client): use typed HTTP response models instead of serde_json::Value
This commit is contained in:
@@ -112,9 +112,9 @@ async fn test_real_api_authenticated_order_flow() {
|
||||
println!("PASS: Order posted successfully!");
|
||||
|
||||
// Step 5: Cancel the order
|
||||
if let Some(order_id) = response.get("orderID").and_then(|v| v.as_str()) {
|
||||
println!("Step 5: Canceling order {}...", order_id);
|
||||
let cancel_result = client.cancel(order_id).await;
|
||||
if !response.order_id.is_empty() {
|
||||
println!("Step 5: Canceling order {}...", response.order_id);
|
||||
let cancel_result = client.cancel(&response.order_id).await;
|
||||
assert!(
|
||||
cancel_result.is_ok(),
|
||||
"Failed to cancel order: {:?}",
|
||||
|
||||
@@ -41,9 +41,9 @@ async fn test_post_order_authentication() {
|
||||
println!(" Response: {:?}", response);
|
||||
|
||||
// Try to cancel it if we got an order ID
|
||||
if let Some(order_id) = response.get("orderID").and_then(|v| v.as_str()) {
|
||||
if !response.order_id.is_empty() {
|
||||
println!("\nStep 3: Canceling order...");
|
||||
match client.cancel(order_id).await {
|
||||
match client.cancel(&response.order_id).await {
|
||||
Ok(_) => println!("Order canceled successfully"),
|
||||
Err(e) => println!("Cancel failed (order might have expired): {:?}", e),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user