toJsonLd method

  1. @override
Map<String, dynamic> toJsonLd()
override

Serialize SchemaComment to JSON-LD

Implementation

@override
Map<String, dynamic> toJsonLd() => removeEmpty({
      ...super.toJsonLd(),
      '@type': 'Comment',
      'downvoteCount': convertToJsonLd(downvoteCount),
      'parentItem': convertToJsonLd(
          parentItem, (v) => v is SchemaComment || v is SchemaCreativeWork),
      'sharedContent': convertToJsonLd(sharedContent),
      'upvoteCount': convertToJsonLd(upvoteCount),
    });