SAI icon indicating copy to clipboard operation
SAI copied to clipboard

mandatory on create + condition

Open itaibaz opened this issue 5 years ago • 1 comments

According to my understanding, when an AttrA is marked MANDATORY_ON_CREATE, and in addition there is a condition AttrB=X or AttrB=Y, this means that a value must be supplied for AttrA on object create if AttrB=X or Y. There is no limitation on the validity of AttrA for other values of AttrB. For example, if AttrB=Z, then AttrA is still valid and a value can be provided on create, but it's not mandatory to do so @kcudnik can you please comment on this, this question was raised today during SAI meeting, thanks

itaibaz avatar Jul 31 '20 00:07 itaibaz

if you have condition, then AttrA is mandatory only when = X or = Y, not Z, even if AttrA value is valid. Currently in sonic/sairedis metadata validation does not allow to pass AttrA if condition is not met, even in AttrA have valid value. is that answering your question ?

kcudnik avatar Jul 31 '20 07:07 kcudnik