BlogBlogA 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. capvalcapvalReplaces the message a failed input validation annotation returns, and adds @validation.handler, which names a class that runs a check of the developer's own.independent, cap, 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 validationRejecting 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.capvalCAPcapvalReplaces 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
MattBrightmanMattBrightmanWrote this
In the atlas: maintains 1, contributes to 1, wrote 2@MertSAPauthor
In the atlas: maintains 1, contributes to 1, wrote 2@MertSAPauthor
Properties
About this work
What was found on the page
Prose
383 words
Code blocks
4
Repository links
1
For input-validation
Applies in
For mertsap-capval
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`.
Group by
Piece, what it offersStill applies
Declarative Programming in CAP: Less Code, More ValueDeclarative Programming in CAP: Less Code, More ValueAn argument for annotations over handlers, made from the case where it is most obvious: repetitive validation logic that could be declared instead of written. Describes what you want rather than how to get it, and lets the runtime decide the how.published 2026-02-05
CAPVAL: A project is bornCAPVAL: A project is bornThis second CAPVAL post announces CAPVAL version 2.0, made compatible with CAP v8 after breaking changes there, with the fix shown as a custom cds.middlewares.after error handler. It restates the plugin's @validation.message annotation alongside standard annotations such as @mandatory as the input validation mechanic the project builds on, and the release otherwise adds automated tests and release-automation GitHub Actions rather than new annotations.published 2024-08-26
#CAP-TechBytes Input Validation#CAP-TechBytes Input ValidationThe annotations one at a time — @mandatory, @assert.unique, @assert.range including the enum form, @assert.format — each with what it produces. Ends on error handling, which is the part that decides whether any of it is usable from a UI.Thajunniza, published 2023-07-07
[Part - 1] Enrich CAP based Services with Behaviors using Annotations[Part - 1] Enrich CAP based Services with Behaviors using AnnotationsWalks 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 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.published 2023-01-28
Learn how to define constraints declaratively in your CDS modelLearn how to define constraints declaratively in your CDS modelConstraints expressed in the model rather than checked in a handler — the distinction the atlas draws between input validation the framework enforces and validation somebody writes.SAP
Everything new: Try out the latest features in CAPEverything new: Try out the latest features in CAPCAP (@sap/cds) gains the features this hands-on session works through: declarative constraints, which is the input validation concern, status flows as status transition flows, a cds REPL, extensibility through @sap/cds-oyster, and HCQL, which SAP's abstract calls CAP's native query-over-HTTP protocol, after an opening stretch of AI-driven app development. The abstract names the features and stops there; what each one does is not described. A TechEd 2026 hands-on session (Wednesday 28 October, Berlin), presented by Daniel Hutzel, Daniel Schlachter, Marc Huber and Tim Back, written here from SAP's abstract; the recording is not yet published.
CAPVAL: A project is bornCAPVAL: A project is bornThis second CAPVAL post announces CAPVAL version 2.0, made compatible with CAP v8 after breaking changes there, with the fix shown as a custom cds.middlewares.after error handler. It restates the plugin's @validation.message annotation alongside standard annotations such as @mandatory as the input validation mechanic the project builds on, and the release otherwise adds automated tests and release-automation GitHub Actions rather than new annotations.published 2024-08-26
Details
Graph
Input validationcapability, core and community
capvalartifact
SAP Communitypublishing source
SAP Communitycap-tag
Source
Type
blog
Published on
Host
community.sap.com
Discovered via
First seen
History
- 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-capvalThe 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 predatesThe 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:mertsapThe 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