in generator/generate.ts [75:89]
async function handleGeneratedSchema(readme: string, schemaPath: string, namespace: string, autoGenConfig?: AutoGenConfig) {
const apiVersion = path.basename(path.resolve(`${schemaPath}/..`));
const schemaConfigs = await generateSchemaConfigs(schemaPath, namespace, apiVersion, autoGenConfig);
for (const schemaConfig of schemaConfigs) {
const unknownScopeResources = schemaConfig.references.filter(x => x.scope & ScopeType.Unknown);
if (autoGenConfig && unknownScopeResources.length > 0) {
throw new Error(`Unable to determine scope for resource types ${unknownScopeResources.map(x => x.type).join(', ')} in readme ${readme}`);
}
await saveSchemaFile(schemaConfig);
}
return schemaConfigs;
}