refactor(schema): simplify validation and OpenAPI generation (#2709)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-11 23:24:26 +02:00
1 parent 4bc5593f9f
commit de1fd95a99
510 files changed
+29494 -36131

No files matched your search

@@ -1,7 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {type ConfigObject, isConfigObject} from '@fluxer/config/src/config_loader/ConfigObject';
type ConfigPathKey = string | number;
type ConfigObject = Record<string, unknown>;
type ConfigContainer = ConfigObject | Array<unknown>;
type EnvValueParser = (raw: string) => unknown;
@@ -436,12 +437,8 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
FLUXER_GEOIP_DB_PATH: {path: ['geoip', 'maxmind_db_path']},
};
function isPlainObject(value: unknown): value is ConfigObject {
return value !== null && typeof value === 'object' && !Array.isArray(value);
}
function isContainer(value: unknown): value is ConfigContainer {
return isPlainObject(value) || Array.isArray(value);
return isConfigObject(value) || Array.isArray(value);
}
function createChildContainer(nextKey: ConfigPathKey | undefined): ConfigContainer {