an object with fixed shape but random keys in the table schema
I wanted to ask if it possible to have in the table schema an object with fixed shape but random keys of type string. For example how do represent the below type as table schema.
type TableSchema = {
name: string;
data: {
[key: string]: {
value: string;
};
};
};
Currently the only way I know how to do this, is to set data to type
any
which can be very annoying as the object get more complex.2 Replies
Hey @fawwaz, we don’t have a validator for this type yet. You can use v.any, or switch to an array like v.array(v.object({key: string, value: string}))
that's not a bad idea, thanks @Michal Srb