Onto-Med / top-backend

Spring Boot based backend of the TOP Framework
MIT License
0 stars 1 forks source link

Call of `getDocuments()` with empty document ID list returns all documents #219

Open ChristophB opened 2 months ago

ChristophB commented 2 months ago

For queries with an empty result set, getDocuments(...) is called with an empty array as documentIds parameter and returns all documents. The expected behaviour is to return an empty list of documents.

fmatthies commented 2 months ago

That's right. This is an oversight in the interaction between frontendbackend. However, I would rather intercept this case in the frontend.

ChristophB commented 2 months ago

I would prefer to handle this case in the backend, because it does not feel right from a REST API perspective to return all documents.

fmatthies commented 2 months ago

I understand the notion, but I have the feeling, that it's kind of odd to provide an empty filter (if it's empty nothing gets filtered) and get nothing in return. You might as well not request it at all if you know it gives an empty return?