Three pairs of methods
FastAPI's WebSocket object gives you three matched send/receive pairs: send_text/receive_text for strings, send_json/receive_json for auto-serialized JSON dicts, send_bytes/receive_bytes for raw binary. receive_json() parses for you; send_json() stringifies for you. For 95% of applications you only ever use the JSON pair.
iter_text and iter_json
Instead of a manual while True loop, FastAPI exposes async iterators: async for msg in websocket.iter_json():. Cleaner code; same behavior; the iterator stops on disconnect (no WebSocketDisconnect handling needed for the iter form).
send_json is not opinionated about format
send_json(obj) sends whatever json.dumps(obj) would produce. It does not impose a type/data envelope. That is your job — Track 5 covers protocol design.