{"ref":"content:extend-cap-validations-with-the-capval-plugin","page":"/content/extend-cap-validations-with-the-capval-plugin","json":"/content/extend-cap-validations-with-the-capval-plugin.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"extend-cap-validations-with-the-capval-plugin","title":"Extend SAP Cloud Application Programming Model(CAP) Validations with the CAPVAL Plugin","url":"https://community.sap.com/t5/technology-blog-posts-by-members/extend-sap-cloud-application-programming-model-cap-validations-with-the/ba-p/13574272","content_type":"blog","explains":[{"ref":"capability:input-validation","applies_to":{"ecosystems":["cap"]}},{"ref":"artifact:mertsap-capval","what_it_covers":"Announces the plugin and shows both of its annotations: `@validation.message` on a `@mandatory` element, with and without an `i18n>` key, and `@validation.handler` pointing at a class that implements `isValid`."}],"summary":"The complaint first: the built-in annotations are good for data integrity and poor at telling the user what went wrong, and there is no way to reuse a rule. [capval](artifact:mertsap-capval), the plugin the post announces, adds `@validation.message` alongside the standard annotations rather than replacing them, and `@validation.handler` for a check written as a class. Published in January 2024, before the 1.2.0 line the README now pairs with `@sap/cds` 8.0.0 and above; the two annotations it shows are the two the README still documents.","short":"Plugin adding custom messages and reusable rules to CAP validation","authors":["actor:mertsap"],"published":"2024-01-09","sources":[{"url":"https://community.sap.com/t5/technology-blog-posts-by-members/extend-sap-cloud-application-programming-model-cap-validations-with-the/ba-p/13574272","title":"Extend SAP Cloud Application Programming Model(CAP) Validations with the CAPVAL Plugin — SAP Community","checked":"2026-09-08","quote":"As a result of this consideration I have written a plugin called CAPVAL, in the hope that I can address this common problem by extending the standard variations provided."},{"url":"https://github.com/MertSAP/CAPVAL","title":"MertSAP/CAPVAL — README","checked":"2026-09-26","quote":"For @sap/cds version less than 8.0.0 use CAPVAL version 1.1.0. Use CAPVAL version 1.2.0 and above for @sap/cds version 8.0.0 and above"}],"provenance":{"discovered_via":[{"source":"source:sap-community","channel":"cap-tag"}],"first_seen":"2026-09-08"},"history":[{"date":"2026-09-26","field":"explains","from":"capability:input-validation","to":"capability:input-validation, artifact:mertsap-capval","reason":"The plugin entered the graph in the same batch, so the post now attaches to it as well as to the capability it explains."},{"date":"2026-09-26","field":"summary","from":"closed on \"the plugin itself is not yet an entry here\"","to":"closes on what the post predates","reason":"The artifact entry contradicts the old closing sentence. What replaces it is the gap between the post's date and the 1.2.0 line the README pairs with @sap/cds 8.0.0 and above."},{"date":"2026-09-26","field":"authors","from":"author: MattBrightman","to":"actor:mertsap","reason":"The actor entered with the artifact. The post says \"I have written a plugin called CAPVAL\" and sends the reader to GitHub, where the repository is MertSAP/CAPVAL, and npm lists mertsap as the maintainer of capval."},{"date":"2026-10-17","field":"explains","from":null,"to":"applies_to on capability:input-validation","reason":"Door scope derived from the artifacts this piece also explains, so a door page lists it only where it holds (docs/concepts/content-on-doors.md)."}],"drafted_with_ai":true,"published_on":"source:sap-community"},"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 33 months ago"}],"compatibility":[{"label":"Version","tier":"unknown","evidence":"no version declared"},{"label":"Moved since?","tier":"poor","evidence":"capval 2.0 since publication"},{"label":"Findings","tier":"good","evidence":"none flagged"}],"reach":[{"value":5317,"unit":"views"},{"value":5,"unit":"comments"},{"value":10,"unit":"likes"}]},"signals":{"views":5317,"likes":10,"comments":5,"metrics_at":"2026-10-25"},"series":null,"edges":{"authors":[{"ref":"actor:mertsap","name":"MattBrightman","json":"/actors/mertsap.json"}]}}