PcoResource.fromJson constructor

PcoResource.fromJson(
  1. String pcoApplication,
  2. String resourceType,
  3. Map<String, dynamic> data, {
  4. List<Map<String, dynamic>>? withIncluded,
})

Implementation

PcoResource.fromJson(
  this.pcoApplication,
  this.resourceType,
  Map<String, dynamic> data, {
  List<Map<String, dynamic>>? withIncluded,
}) {
  if (!data.containsKey('type')) {
    print(data);
    throw FormatException(
        'data supplied does not meet JSON:API specs. No "type" field found');
  }
  fromJson(data, withIncluded: withIncluded);
}