toJson method
Converts the model instance into JSON, applying the attribute metadata.
Implementation
String toJson({ValueCodecRegistry? registry, bool includeHidden = false}) {
return jsonEncode(
toArray(
registry: _effectiveCodecRegistry(registry),
includeHidden: includeHidden,
),
);
}