I'm receiving a path parameter called id in a get method in my controller as an integer. When the controller receives it it obviously casts the incoming string parameter called id to an integer. But if I leave the id field empty when I call the controller I get a 400 Bad Request since it can't cast an empty string to an integer. Is there any way around this? I need it to be an integer so I can do a check that the id value is a positive integer ie id > 0.
Anyone?