From 83b4beb3bdaca9c4f38775fe5dce15b5267e40c3 Mon Sep 17 00:00:00 2001 From: David Arayan Date: Thu, 15 Feb 2024 23:50:53 +1100 Subject: [PATCH] - Ensure default schema types do not get generated --- sdk-core/src/generator/generator.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk-core/src/generator/generator.ts b/sdk-core/src/generator/generator.ts index f4e921d..e5f759b 100644 --- a/sdk-core/src/generator/generator.ts +++ b/sdk-core/src/generator/generator.ts @@ -1,4 +1,4 @@ -import { CoreController, ObjectSchema } from "@plattar/api-core"; +import { CoreController, ObjectSchema, Util } from "@plattar/api-core"; import { GeneratedProject, PackageJsonVars, Project } from "./generators/project"; import { Schema } from "./generators/schema"; import fs from "fs"; @@ -27,7 +27,9 @@ export class Generator { // generate the schema source files // each schema can generate multiple schema files based on endpoints collections.forEach((schema: typeof ObjectSchema, endpoints: Array) => { - schemas.push(new Schema().generate(schema, endpoints)); + if (schema.type !== Util.DEFAULT_OBJECT_TYPE) { + schemas.push(new Schema().generate(schema, endpoints)); + } }); const outputDir: string = `./${data.output}/${data.package.name}-sdk`;