Map<String, Object?> toJsonSchema() => { 'type': type.jsonName, if (description.isNotEmpty) 'description': description, 'enum': ?allowed, };