Skip to Content
0
Aug 28, 2023 at 09:42 AM

How to apply one-side range validation in CAP?

180 Views

Hi colleagues,

Is there any way in CAP to validate a value agains some range with only one side restricted by just annotations?

unfortunately @assert.range has only 2-sides restriction as per documentation

https://cap.cloud.sap/docs/guides/providing-services#assert-range

The most common case is when I want to restrict my number with non-negative (>= 0) or positive (> 0) value.

Thank you.