AdditionalExpectedResponse.fromJson constructor

AdditionalExpectedResponse.fromJson(
  1. Map<String, dynamic> json,
  2. String formContentType,
  3. PrefixMapping prefixMapping
)

Creates an AdditionalExpectedResponse from a json object.

Implementation

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

  final contentType =
      json.parseField<String>("contentType", parsedFields) ?? formContentType;
  final success = json.parseField<bool>("success", parsedFields) ?? false;
  final schema = json.parseField<String>("schema", parsedFields);
  final additionalFields =
      json.parseAdditionalFields(prefixMapping, parsedFields);

  return AdditionalExpectedResponse(
    contentType,
    schema: schema,
    success: success,
    additionalFields: additionalFields,
  );
}