ayon-backend
ayon-backend copied to clipboard
Resolver: Sane responses in the case of errors
Story
Currently /api/resolve
does not correctly handle malformed URIs as mentioned here https://github.com/ynput/ayon-backend/issues/283
Problems
When a malformed URI is present in the request, the entire request fails with error 500 (which implies a server problem rather than client).
Proposal
- When a request contains a malformed uri, 400 response should be returned instead, keeping 500 for real errors
- Add
canFail
option to the request model, that would allow skipping erroring URIs instead of failing the entire query similarly to/api/projects/{projectName}/operations
- in that case, skipped entities could be either simply excluded (similarly as they were missing) or included with a status code per record
Tagging @dee-ynput @Lypsolon and @BigRoy for visibility