decodeString method

String decodeString(
  1. String jsonPath,
  2. Object? json
)
inherited

Decode a JSON object that is expected to be a string.

Implementation

String decodeString(String jsonPath, Object? json) {
  if (json is String) {
    return json;
  } else {
    throw mismatch(jsonPath, 'String', json);
  }
}