Fix ignored request schemas

This commit is contained in:
Rory& committed 2025-10-04 19:09:25 +02:00
1 parent 9ef9744332
commit efba3f245d
3 files changed
+47 -4

No files matched your search

+7 -1
View File
@@ -32,6 +32,11 @@ import {
import { AnyValidateFunction } from "ajv/dist/core";
import { NextFunction, Request, Response } from "express";
const ignoredRequestSchemas = [
// skip validation for settings proto JSON updates - TODO: figure out if this even possible to fix?
"SettingsProtoUpdateJsonSchema"
]
declare global {
// TODO: fix this
// eslint-disable-next-line @typescript-eslint/no-namespace
@@ -119,7 +124,8 @@ export function route(opts: RouteOptions) {
}
}
if (validate) {
if (validate && !ignoredRequestSchemas.includes(opts.requestBody!)) {
const valid = validate(req.body);
if (!valid) {
const fields: Record<