{"ref":"content:part-1-enrich-cap-based-services-with-behaviors-using-annotations","page":"/content/part-1-enrich-cap-based-services-with-behaviors-using-annotations","json":"/content/part-1-enrich-cap-based-services-with-behaviors-using-annotations.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"part-1-enrich-cap-based-services-with-behaviors-using-annotations","title":"[Part - 1] Enrich CAP based Services with Behaviors using Annotations","url":"https://community.sap.com/t5/technology-blog-posts-by-sap/part-1-enrich-cap-based-services-with-behaviors-using-annotations/ba-p/13556011","content_type":"blog","published_on":"source:sap-community","explains":[{"ref":"capability:input-validation","applies_to":{"ecosystems":["cap"]}},{"ref":"capability:authorization","applies_to":{"ecosystems":["cap"]}}],"summary":"Walks through CDS annotations that add behaviour beyond CRUD: @readonly and @insertonly take away write, update or delete on an entity or element, each shown with the OData metadata it generates. @mandatory, @assert.unique, @assert.integrity, @assert.format and @assert.range then enforce input checks that [@sap/cds](artifact:sap-cds) runs on write, with the SQL or HANA constraint @assert.unique compiles to and the error code each rejection returns. It names @restrict and @requires but defers them, calling authorization too large a topic for this post.","short":"CDS annotations adding behaviour to CAP services, part 1","authors":["actor:ajitkp91"],"published":"2023-01-28","provenance":{"discovered_via":[{"source":"source:sap-community","channel":"cap-tag"}],"first_seen":"2026-09-28"},"drafted_with_ai":true,"history":[{"date":"2026-10-17","field":"explains","from":null,"to":"applies_to on capability:input-validation (cap); capability:authorization (cap)","reason":"Door scope proposed from the title and summary, so a door page lists the piece only where it holds (docs/concepts/content-on-doors.md)."}]},"readings":{"liveness":[{"label":"Checked against the source","tier":"unknown","evidence":"nobody has checked it"},{"label":"Source reachable","tier":"unknown","evidence":"not crawled"},{"label":"Age","tier":"poor","evidence":"published 45 months ago"}],"compatibility":[{"label":"Version","tier":"unknown","evidence":"no version declared"},{"label":"Moved since?","tier":"poor","evidence":"@sap/cds 8.5.0, 2024-11 and 2 more"},{"label":"Findings","tier":"good","evidence":"none flagged"}],"reach":[{"value":9368,"unit":"views"},{"value":5,"unit":"comments"},{"value":19,"unit":"likes"}]},"signals":{"views":9368,"likes":19,"comments":5,"metrics_at":"2026-10-25"},"series":null,"edges":{"authors":[{"ref":"actor:ajitkp91","name":"Ajit Kumar Panda","json":"/actors/ajitkp91.json"}]}}