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, [int]),
      'parentItem':
          convertToJsonLd(parentItem, [SchemaComment, SchemaCreativeWork]),
      'sharedContent': convertToJsonLd(sharedContent, [SchemaCreativeWork]),
      'upvoteCount': convertToJsonLd(upvoteCount, [int]),
    });