A student was given this JSON protocol specification: Reques…
A student was given this JSON protocol specification: Request: { “type”: “get_weather”, “city”: “Phoenix” } Success Response: { “ok”: true, “temperature”: 75, “condition”: “sunny” } Error Responses: – Unknown city: { “ok”: false, “error”: “city not found” } – Missing city: { “ok”: false, “error”: “city field is required” } A server was implemented, we send two requests and got the following responses: Request 1: { “type”: “get_weather”, “city”: “Phoenix” } Response 1: { “ok”: true, “temp”: 75, “condition”: “sunny” } Request 2: { “type”: “get_weather”, “city”: “UnknownCity” } Response 2: { “success”: false, “temperature”: 0, “error”: “city not found” } 1. List all protocol violations across both responses. 2. Write out how the responses should look like.
Read Details