BlogBlogtypeA post on somebody's own site or a community platform. Nobody edits it after publication, so it dates from the day it was written.See every one →SAP Community

Extend SAP Cloud Application Programming Model(CAP) Validations with the CAPVAL Plugin

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, 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.

Where it sits

Explains
Input validationCAPInput validationcapabilityRejecting bad input before it reaches the database. While this can be done manually inside a handler, there are solutions in place to derive type, range, enum and mandatory checks from the model definitions.capvalCAPcapvalcds-pluginReplaces the message a failed [input validation](capability:input-validation) annotation returns, and adds `@validation.handler`, which names a class that runs a check of the developer's own.
Source
reachable

Who is behind it

MattBrightmanMattBrightmanPersonWrote this
In the atlas: maintains 1, contributes to 1, wrote 2
@MertSAP
author

Properties

About this work

declared and crawled
Published
declared
Published on
declared
Views
crawled
5,317

What was found on the page

derived
Prose
derived
383 words
Code blocks
derived
4
Repository links
derived
1

For input-validation

on the edge
Applies in
authored
cap

For mertsap-capval

on the edge
Covers
authored
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`.

More on this7

Group by
Piece, what it offersStill applies
Also explainingInput validation6
Declarative Programming in CAP: Less Code, More Value
SAP Community, BirgitSThe reasoning
nothing recorded
CAPVAL: A project is born
SAP Community, MattBrightman
nothing recorded
#CAP-TechBytes Input Validation
SAP Community, ThajunnizaThe reasoning
nothing recorded
[Part - 1] Enrich CAP based Services with Behaviors using Annotations
SAP Community, Ajit Kumar Panda
nothing recorded
Learn how to define constraints declaratively in your CDS model
SAP Developer Center, SAPThe reasoningA recipe
nothing recorded
Everything new: Try out the latest features in CAP
SAP TechEd — session catalogue, Daniel Hutzel, Daniel SchlachterA recipe
nothing recorded
CAPVAL: A project is born
SAP Community, MattBrightman
nothing recorded

Details

Graph5 edges
← POINTS HERE
POINTS OUT →
explainsInput validationcapability, core and community
explainscapvalartifact
published onSAP Communitypublishing source
discovered viaSAP Communitycap-tag
Source
Type
blog
Published on
Host
community.sap.com
First seen
History5
  • explains → applies_to on capability:input-validationDoor 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).
  • explains → capability:input-validation, artifact:mertsap-capvalfrom capability:input-validationThe plugin entered the graph in the same batch, so the post now attaches to it as well as to the capability it explains.
  • summary → closes on what the post predatesfrom closed on "the plugin itself is not yet an entry here"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.
  • authors → actor:mertsapfrom author: MattBrightmanThe 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.
  • Entered the atlasDiscovered via SAP Community · cap-tag.
For your agent
Ref
content:extend-cap-validations-with-the-capval-plugin
JSON
/content/extend-cap-validations-with-the-capval-plugin.json
MCP
Connecting an agent