sdk-java icon indicating copy to clipboard operation
sdk-java copied to clipboard

Custom validation for context attributes in wrapper library

Open touchkey opened this issue 2 years ago • 1 comments
trafficstars

Hi Team,

What is the way to add a custom validation for cloudevents? My requirement - I want to add some mandatory validation w.r.t our organization and keep this in our cloudevents wrapper library. This wrapper library will be used by hundreds of customer. By adding this in our library we are avoiding each validation to be added by each customer. Basically, we want to generalize the validation in wrapper library according to our organization need.

Let's say I want to check whether some context attributes added or not from our organization perspective? I see that build method in CloudEventBuilder class has mandatory validation for source, type and id(link). Similarly I want to check this for context attributes when we call build method. Pls suggest if there is any other good way other than this.

Regards

touchkey avatar Sep 27 '23 15:09 touchkey

Hi @touchkey, currently, there isn't a native way of adding additional validations

pierDipi avatar Sep 28 '23 06:09 pierDipi