dereference method

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

Implementation

RequestBody dereference({
  required Map<String, RequestBody>? components,
}) {
  if (ref == null) {
    return this;
  }
  final rRef = components?[ref?.split('/').last];
  if (rRef == null) {
    throw Exception(
      "\n\n'$ref' is not a valid component request body reference\n",
    );
  }
  return rRef.copyWith(
    ref: ref,
    description: description ?? rRef.description,
  );
}