Skip to content

Commit

Permalink
fix: ignore missing resource types from map
Browse files Browse the repository at this point in the history
  • Loading branch information
invakid404 committed Nov 18, 2024
1 parent dead5e7 commit dead118
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/generator/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ export const generateResources = async () => {
resource_type: resourceTypeName,
path,
} of listResources()) {
if (!(resourceTypeName in allResourceTypes)) {
continue;
}

const paths = resourcesByType.get(resourceTypeName) ?? [];
resourcesByType.set(resourceTypeName, [...paths, path]);
}

for (const [resourceTypeName, paths] of resourcesByType) {
const resourceType = allResourceTypes[resourceTypeName]!;
if (resourceType == null) {
continue;
}

const typeSchemaName = resourceTypeSchemaName(resourceType.name);
const resourceTypeSchema = schemaToZod(resourceType.schema as never, {
Expand Down

0 comments on commit dead118

Please sign in to comment.