Skip to content

Commit

Permalink
Don't allow defining types, errors in api.yml (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkirsch authored Oct 12, 2022
1 parent e8dc9ba commit 3f20fb2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,5 @@ export async function generateIntermediateRepresentation(workspace: Workspace):
});
}

await visitServiceFile({ file: rootApiFile, schema: workspace.rootApiFile });

return intermediateRepresentation;
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { z } from "zod";
import { ApiAuthSchema } from "../ApiAuthSchema";
import { AuthSchemeDeclarationSchema } from "../AuthSchemeDeclarationSchema";
import { ErrorDeclarationSchema } from "../ErrorDeclarationSchema";
import { TypeDeclarationSchema } from "../TypeDeclarationSchema";

export const RootApiFileSchema = z.strictObject({
name: z.string(),
imports: z.optional(z.record(z.string())),
auth: z.optional(ApiAuthSchema),
"auth-schemes": z.optional(z.record(AuthSchemeDeclarationSchema)),
imports: z.optional(z.record(z.string())),
types: z.optional(z.record(TypeDeclarationSchema)),
errors: z.optional(z.record(ErrorDeclarationSchema)),
});

export type RootApiFileSchema = z.infer<typeof RootApiFileSchema>;

0 comments on commit 3f20fb2

Please sign in to comment.