toJson method
Convert to json object.
Implementation
String toJson() => switch (this) {
string => 'STRING',
number => 'NUMBER',
integer => 'INTEGER',
boolean => 'BOOLEAN',
array => 'ARRAY',
object => 'OBJECT',
};