feat: add batch create/update/delete item contracts - #37
Conversation
…ontracts Expose three new Item Management operations for submitting a list of namespace items to create, update, or delete in one call: - POST .../items/batch-create (batchCreateItems) - PUT .../items/batch-update (batchUpdateItems) - POST .../items/batch-delete (batchDeleteItems) Bump version to 0.3.11.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nobodyiam
left a comment
There was a problem hiding this comment.
The three batch paths and generated Spring signatures align with the companion implementation, and the local contract and generation checks pass. One contract mismatch remains.
Please fix this blocking item before updating:
- In
apollo-openapi.yaml, express the runtime batch validation in the contract: addminItems: 1to all three request arrays, addminLength: 1to the batch-delete key items, and document400withExceptionResponseforbatchDeleteItems. Please extendtests/test_item_batch_contract.pyaccordingly. The companion controller rejects these inputs with HTTP 400, so v0.3.11 should not advertise them as valid or leave that response undocumented.
- Add minItems: 1 to the batch-create/update/delete request arrays - Add minLength: 1 to batch-delete's key items - Document 400 with ExceptionResponse for batchDeleteItems - Extend tests/test_item_batch_contract.py to cover these constraints Addresses nobodyiam's review on PR apolloconfig#37: the companion apolloconfig/apollo#5665 controller already rejects these inputs with HTTP 400, so the contract should advertise the same constraints instead of leaving them undocumented. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Expose three new operations backed by the existing ItemChangeSets batch plumbing (ItemService.updateItems), so callers can submit a list of items to create, update, or delete against a single namespace in one call instead of one item at a time: - POST .../items/batch-create - PUT .../items/batch-update - POST .../items/batch-delete Bumps apollo-openapi spec to v0.3.11, which defines the new contracts (apolloconfig/apollo-openapi#37). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
I rechecked head Note: this reply was generated and posted automatically by AI for initial triage; a maintainer will follow up if needed. |
nobodyiam
left a comment
There was a problem hiding this comment.
Rechecked head 62d3b987d3da8e2ee1e6de8639f0b345671abc6b. The previous blocking contract/runtime mismatch is fully resolved: all three request arrays enforce minItems: 1, batch-delete keys enforce minLength: 1, and batchDeleteItems documents the 400 ExceptionResponse, with corresponding contract coverage.
All 13 repository tests pass locally, OpenAPI validation and Portal generation verification pass, and the generated Spring project compiles successfully. The generated signatures also remain aligned with the latest companion implementation in apolloconfig/apollo#5665.
No remaining blocking findings. Approved.
Before merge, please approve and run the pending General CI Checks workflow and ensure all jobs pass.
) * feat(openapi): add batch create/update/delete for namespace items Expose three new operations backed by the existing ItemChangeSets batch plumbing (ItemService.updateItems), so callers can submit a list of items to create, update, or delete against a single namespace in one call instead of one item at a time: - POST .../items/batch-create - PUT .../items/batch-update - POST .../items/batch-delete Bumps apollo-openapi spec to v0.3.11, which defines the new contracts (apolloconfig/apollo-openapi#37). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix: address nobodyiam's review on batch item OpenAPI operations - Preserve existing item type in batchUpdateItems instead of unboxing a null OpenItemDTO.type, which NPE'd when the field was omitted - Reject null elements in batch-create/batch-update payloads with 400 instead of letting them NPE into a 500 - Align batch-create operator docs with the actual single batch-operator behavior (no per-item dataChangeCreatedBy fallback), matching batch-update/batch-delete - Fix invalid heading-fragment anchors in the OpenAPI platform docs - Add a CHANGES.md entry for PR #5665 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> # Conflicts: # CHANGES.md --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Summary
POST .../items/batch-create(batchCreateItems)PUT .../items/batch-update(batchUpdateItems)POST .../items/batch-delete(batchDeleteItems)Motivation
Apollo's OpenAPI item endpoints only support single-item create/update/delete (plus namespace-text replace and cross-namespace sync/diff). There's no operation for submitting a structured batch of creates/updates/deletes against a single namespace. This is a companion PR to a corresponding
apolloconfig/apollochange that implements these operations against the existing internalItemChangeSetsbatch plumbing.Test plan
./generate.sh --verifypython -m unittest tests/test_item_batch_contract.py🤖 Generated with Claude Code