I'm building an API that, among other things, will allow the consumer to create a record. That record can have an array of images (passed as URLs). Assume that the consumer passes an array of image URLs, but some return a 404, exceeds a file size limit, etc. -- what should the API do? I see two possible options:
- Fail. Report back to the consumer on the first sign of trouble.
- Create the record anyway, skipping the invalid URLs and just report back to the consumer which image URLs failed and why.
I'm trying to use JSON API for my request and response format. Per the spec, it says that:
The members data and errors MUST NOT coexist in the same document.
This would suggest that my option #2 is a no-go. Thoughts?