async function findAllResourceReferences()

in generator/cmd/listresources.ts [71:86]


async function findAllResourceReferences() {
  let allRefs: string[] = [];
  for (const rootSchemaPath of rootSchemaPaths) {
    const rootSchema = await readSchema(rootSchemaPath);
    const schemaRefs = findAllReferences(rootSchema)
      .filter(schema => schema.toLowerCase().startsWith(schemasBaseUri.toLowerCase() + '/'));

    allRefs = allRefs.concat(schemaRefs);
  }

  for (const rootSchemaPath of rootSchemaPaths) {
    allRefs = allRefs.filter(ref => lowerCaseCompare(ref.split('#')[0], rootSchemaPath) !== 0);
  }

  return [...new Set(allRefs)];
}