Skip to content

Commit 69ac22d

Browse files
committed
feat: disable security when isDev is set
1 parent 496cbaa commit 69ac22d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/app.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,14 @@ export async function initApp(inOtomiStack?: OtomiStack) {
212212
apiSpec: path.join(__dirname, 'generated-schema.json'),
213213
validateRequests: {
214214
allowUnknownQueryParameters: false,
215-
coerceTypes: 'array',
215+
coerceTypes: 'array', // coerce scalar data to an array with one element and vice versa (as required by the schema).
216216
},
217217
validateResponses: false, // Start with false, can enable later for debugging
218-
validateSecurity: {
219-
handlers: {
220-
groupAuthz: groupAuthzSecurityHandler,
221-
},
222-
},
218+
validateSecurity: env.isDev
219+
? false
220+
: {
221+
handlers: { groupAuthz: groupAuthzSecurityHandler },
222+
},
223223
operationHandlers: path.join(__dirname, 'api'), // Enable operation handlers
224224
ignorePaths: /\/api-docs/, // Exclude swagger docs
225225
}),

0 commit comments

Comments
 (0)