dereference method

PathItem dereference({
  1. required Map<String, PathItem>? components,
})

Implementation

PathItem dereference({
  required Map<String, PathItem>? components,
}) {
  if (ref == null) {
    return this;
  }
  final pRef = components?[ref?.split('/').last];
  if (pRef == null) {
    throw Exception(
      "\n\n'$ref' is not a valid component path item reference\n",
    );
  }

  _checkReferenceTypes(ref, pRef, this);

  return pRef.copyWith(
    ref: ref,
    summary: summary ?? pRef.summary,
    description: description ?? pRef.description,
  );
}