masumsoft/express-cassandra

Validators in UDTs

Cleomir opened this issue · 0 comments

Hello,
I'm trying to define the following UDT:

udts: { address: { street: 'text', city: 'text', postal: 'text', state: 'text', country: 'text', address_type: { type: 'text' rule: { validator(value: string) { return value === 'residential' || value === 'commercial'; } } }, } }

And I'm getting the following error:
apollo.model.save.dberror: Error during save query on DB -> ResponseError: line 1:120 no viable alternative at input '[' (..."state" text,"country" text,"address_type" [[]...)

It's not clear in the documentation if it's possible to define validators inside UDTs or if it's a bug.