ExpectedResponse.fromJson constructor

ExpectedResponse.fromJson(
  1. Map<String, dynamic> json,
  2. PrefixMapping prefixMapping
)

Creates an ExpectedResponse from a json object.

Implementation

factory ExpectedResponse.fromJson(
  Map<String, dynamic> json,
  PrefixMapping prefixMapping,
) {
  final Set<String> parsedFields = {};

  final contentType =
      json.parseRequiredField<String>("contentType", parsedFields);
  final additionalFields =
      json.parseAdditionalFields(prefixMapping, parsedFields);

  return ExpectedResponse(contentType, additionalFields: additionalFields);
}