code: def build_schema_mapping(schema_dir, resource_listing):
      
      def resource_name_to_filepath(name):
          return os.path.join(schema_dir, '{0}.json'.format(name))
  
      return dict(
          (resource, resource_name_to_filepath(resource))
          for resource in find_resource_names(resource_listing)
      )
docs: Discovers schema file locations and relations.
  
      :param schema_dir: the directory schema files live inside
      :type schema_dir: string
      :param resource_listing: A swagger resource listing
      :type  resource_listing: dict
      :returns: a mapping from resource name to file path
      :rtype: dict