HTTP endpoints are better with type checking. Adding a Record type to a POST request will ensure the correct data is sent every time.
{ "operand1": 4, "operand2": 10.2, "operator": "+" }
{ "expression": "4+10.2", "result": 14.2 }
Sign up to Exercism to learn and master Ballerina with 58 exercises, and real human mentoring, all for free.