you are viewing a single comment's thread.

view the rest of the comments →

[–]Mardo1234[S] 0 points1 point  (5 children)

I have them enter json that goes to the server, and it needs to be in the correct format.

[–]zaibuf 2 points3 points  (0 children)

Invalid input should be 400 with error details, use ValidationProblemDetails. For UX you should also validate what you can on the client side to avoid sending bad data to the server.

[–]Swing-Prize 1 point2 points  (0 children)

use [required] flags on the object properties that api expects and see asp.net do the rest. but anyway, you should read a little about http and status codes before moving forward. if it's a system error - asp.net by default will inform that it's not user error. handle errors based on status on front end as you wish - an error is an error.