With Cds 8 SDM CAP plugin does not work#170
Merged
Merged
Conversation
…into containment-error-cds8
Member
|
Please update screenshots/list-of-scenarios tested |
yashmeet29
reviewed
Sep 4, 2025
Comment on lines
+121
to
+131
| function getId(req) { | ||
| const containmentVal = cds?.env?.odata?.containment; | ||
| let idToUse; | ||
|
|
||
| if (containmentVal === true) { | ||
| idToUse = req.params[1].ID; | ||
| } else { | ||
| idToUse = req.data.ID; | ||
| } | ||
| return idToUse; | ||
| } |
Member
There was a problem hiding this comment.
Refactor getId as
function getId(req) {
const isContainment = cds?.env?.odata?.containment === true;
return isContainment ? req.params[1]?.ID : req.data?.ID;
}
yashmeet29
reviewed
Sep 5, 2025
| let attachment_val_create = []; | ||
| if (req.data.content) { | ||
| attachment_val_create = attachment_val.filter(attachment => attachment.HasActiveEntity === false && attachment.ID === req.params[1].ID); | ||
| attachment_val_create = attachment_val.filter(attachment => attachment.HasActiveEntity === false && attachment.ID ===attachmentID); |
Member
There was a problem hiding this comment.
Please add a space in attachment.ID ===attachmentID, make it attachment.ID === attachmentID
yashmeet29
approved these changes
Sep 5, 2025
Juergen-Goebl-msggroup
pushed a commit
to Andreas-Meindl-msggroup/sdm
that referenced
this pull request
Apr 14, 2026
With Cds 8 SDM CAP plugin does not work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
With Cds 8 SDM CAP plugin does not work none of the api calls work because of req.params[1[.ID which has been added to solve the odata containment issue. But with containment false req.data.ID will work hence added the check.
Any documentation
With Cds 8 SDM CAP plugin does not work none of the api calls work because of req.params[1[.ID which has been added to solve the odata containment issue. But with containment false req.data.ID will work hence added the check.
Scenario's Tested
1)Made cds 8 in leading CAP application and then tested the flow and ran integration test as well.
2)cds 8 and odata containment true in package.json as below
"cds": {
"requires": {
"auth": "jwt",
"db": "hana",
"sdm": {
"settings": {
"repositoryId": "TEST_REPO"
}
}
},
"odata": {
"containment": true
}
},and then tested the flow and ran integration test as well.
3) cds 9 with containment false and then tested the flow and ran integration test as well.
4)cds 9 with containment true and then tested the flow and ran integration test as well.
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested