From 90b0494898d78f17d44852c97040890bc3d0991a Mon Sep 17 00:00:00 2001 From: Adrien Boutigny Date: Fri, 31 May 2024 10:56:25 +0200 Subject: [PATCH] disable config validation when generating types --- confiture-rest-api/package.json | 2 +- confiture-rest-api/src/app.module.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/confiture-rest-api/package.json b/confiture-rest-api/package.json index a14081141..421b4fe27 100644 --- a/confiture-rest-api/package.json +++ b/confiture-rest-api/package.json @@ -13,7 +13,7 @@ "migrate:dev": "prisma migrate dev", "migrate:prod": "prisma migrate deploy", "postinstall": "prisma generate && yarn generate-api-types", - "generate-api-types": "rimraf dist && nest start --entryFile generate-api-typings.js" + "generate-api-types": "rimraf dist && GENERATE_TYPES=1 nest start --entryFile generate-api-typings.js" }, "dependencies": { "@aws-sdk/client-s3": "^3.218.0", diff --git a/confiture-rest-api/src/app.module.ts b/confiture-rest-api/src/app.module.ts index 149f65d6a..937c4ff0f 100644 --- a/confiture-rest-api/src/app.module.ts +++ b/confiture-rest-api/src/app.module.ts @@ -13,7 +13,9 @@ import { UserMiddleware } from "./auth/user.middleware"; imports: [ ConfigModule.forRoot({ isGlobal: true, - validationSchema: configValidationSchema + validationSchema: !process.env.GENERATE_TYPES + ? configValidationSchema + : undefined }), FeedbackModule, AuditsModule,