toJsonLd method

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

Serialize SchemaDiet to JSON-LD

Implementation

@override
Map<String, dynamic> toJsonLd() => removeEmpty({
      ...super.toJsonLd(),
      '@type': 'Diet',
      'dietFeatures': convertToJsonLd(dietFeatures, [String]),
      'endorsers':
          convertToJsonLd(endorsers, [SchemaOrganization, SchemaPerson]),
      'expertConsiderations': convertToJsonLd(expertConsiderations, [String]),
      'physiologicalBenefits':
          convertToJsonLd(physiologicalBenefits, [String]),
      'risks': convertToJsonLd(risks, [String]),
      'code': convertToJsonLd(code, [SchemaMedicalCode]),
      'guideline': convertToJsonLd(guideline, [SchemaMedicalGuideline]),
      'legalStatus': convertToJsonLd(legalStatus,
          [SchemaDrugLegalStatus, SchemaMedicalEnumeration, String]),
      'medicineSystem':
          convertToJsonLd(medicineSystem, [SchemaMedicineSystem]),
      'recognizingAuthority':
          convertToJsonLd(recognizingAuthority, [SchemaOrganization]),
      'relevantSpecialty':
          convertToJsonLd(relevantSpecialty, [SchemaMedicalSpecialty]),
      'study': convertToJsonLd(study, [SchemaMedicalStudy]),
    });