Skip to content

Commit 11a6192

Browse files
authored
Merge branch 'master' into split-dirv2-tests
2 parents 30ca908 + 3ca1fb6 commit 11a6192

File tree

7 files changed

+321
-318
lines changed

7 files changed

+321
-318
lines changed

packages/models-library/src/models_library/batch_operations.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
"""
2+
3+
# Batch Operations Rationale:
4+
5+
Please preserve the following behaviors when implementing batch operations:
6+
7+
| Case | Behavior | Justification |
8+
| -------------- | ------------------------------------------ | --------------------------- |
9+
| Empty `names` | `400 Bad Request` | Invalid input |
10+
| Some missing | `200 OK`, with `missing` field | Partial success |
11+
| Duplicates | Silently deduplicate | Idempotent, client-friendly |
12+
| Response order | Preserve request order (excluding missing) | Deterministic, ergonomic |
13+
14+
15+
- `BatchGet` is semantically distinct from `List`.
16+
- `List` means “give me everything you have, maybe filtered.”
17+
- `BatchGet` means “give me these specific known resources.”
18+
- Passing an empty list means you’re not actually identifying anything to fetch — so it’s a client error (bad request), not a legitimate “empty result.”
19+
- This aligns with the principle: If the request parameters are syntactically valid but semantically meaningless, return 400 Bad Request.
20+
21+
# References:
22+
- https://google.aip.dev/130
23+
- https://google.aip.dev/231
24+
"""
25+
126
from typing import Annotated, Generic, TypeVar
227

328
from common_library.basic_types import DEFAULT_FACTORY

services/catalog/src/simcore_service_catalog/service/catalog_services.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ async def batch_get_user_services(
703703
704704
Raises:
705705
CatalogItemNotFoundError: When no services are found at all
706+
ValidationError: if the ids are empty
706707
"""
707708
unique_service_identifiers = _BatchIdsValidator.validate_python(ids)
708709

0 commit comments

Comments
 (0)