FhirCanonical.fromYaml constructor

FhirCanonical.fromYaml(
  1. dynamic yaml
)

Implementation

factory FhirCanonical.fromYaml(dynamic yaml) => yaml is String
    ? FhirCanonical.fromJson(jsonDecode(jsonEncode(loadYaml(yaml))))
    : yaml is YamlMap
        ? FhirCanonical.fromJson(jsonDecode(jsonEncode(yaml)))
        : throw YamlFormatException<FhirCanonical>(
            'FormatException: "$json" is not a valid Yaml string or YamlMap.');