code: def resolve_references(
      json_mappings: Dict[str, Dict]
  ) -> Dict[str, Dict]:
      # track second pass generated types
      new_types = {}
      for _, json_schema in json_mappings.items():
          replace_types = {}
          for attribute, config in json_schema["properties"].items():
              if "type" in config:
                  _type_str = config["type"]
                  if _type_str in primitive_mapping.values():
                      # no issue with primitive types
                      continue
                  else:
                      # if we don't have a type yet its because its not supported
                      # lets create an empty type to satisfy the generation process
                      if _type_str not in json_mappings.keys():
                          reference = make_fake_type(_type_str)
                          new_types[_type_str] = reference
  
                  # if the type is a reference we need to replace its type entry after
                  replace_types[attribute] = {
                      "$ref": f"./{SCHEMA_FOLDER}/{_type_str}.json"
                  }
          # replace any referenced types
          for k, v in replace_types.items():
              json_schema["properties"][k] = v
  
      # insert any new types created above into the main dict
      for k, v in new_types.items():
          json_mappings[k] = v
  
      return json_mappings
  
file_path: PySyft/packages/syft/src/syft/util/schema.py
imports: from collections import defaultdict
  import json
  import os
  from pathlib import Path
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import Type
  import syft
label_desc: Use image node_id 6 for calling a global function with example usage: resolve_references(json_mappings) and returns: json_mappings