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
Server returns incorrect response when I define two GET request with nearly same pattern.
GET doctor_profile
API path: /doctors/{id}/
GET doctor_feedbacks
API path: /doctors/{id}/feedbacks
Problem: Call GET doctor_feedbacks but server return response for doctor_profile ( If you change adding order of two request server will works well)
Code to reproduce
let firstResponseString = "Doctor profile"
let secondResponseString = "Doctor feedback"
// Doctor profile
server.get("/doctors/{id}/") { request in
return .ok(firstResponseString)
}
// Doctor feedbacks
server.get("/doctors/{id}/feedbacks") { request in
return .ok(secondResponseString)
}
// Test for GET request
let ex1 = expectation(description: "test")
client.request("/doctors/{id}/feedbacks", method: .get)
.responseString { r in
XCTAssertEqual(r.value, secondResponseString)
ex1.fulfill()
}
waitForExpectations()
The text was updated successfully, but these errors were encountered:
Server returns incorrect response when I define two GET request with nearly same pattern.
API path:
/doctors/{id}/
API path:
/doctors/{id}/feedbacks
Problem: Call GET doctor_feedbacks but server return response for doctor_profile ( If you change adding order of two request server will works well)
Code to reproduce
The text was updated successfully, but these errors were encountered: