Define a field to be type A or null

#1

I want to define a field called ‘label’ to be either a ‘Metric’ or null. Basically, if the user doesn’t want to provide a label, he needs to put null explicitly

label: !?Metric schema name 'M'

returns this error:

"no viable alternative at input '!?'",code:"SYNTAX_ERROR"

0 Likes

#2

Just do

label: Metric

There isn’t really such a thing as an explicit “null” in c3.
Treat a missing value as ‘null’

0 Likes