fix(ai): use nullable instead of optional for configFiles in AI suggestion schema (#4732)

OpenAI strict mode for response_format requires every property to be
listed in 'required'. Optional fields must instead be modeled as
nullable so the key stays required while still allowing no value.

Fixes #4267
This commit is contained in:
Mauricio Siu
2026-07-05 15:38:05 -06:00
committed by GitHub
parent b96c5e8655
commit 3e11c0a240

View File

@@ -24,7 +24,7 @@ interface DockerOutput {
dockerCompose: string;
envVariables: Array<{ name: string; value: string }>;
domains: Array<{ host: string; port: number; serviceName: string }>;
configFiles?: Array<{ content: string; filePath: string }>;
configFiles?: Array<{ content: string; filePath: string }> | null;
}
export const getAiSettingsByOrganizationId = async (organizationId: string) => {
@@ -136,7 +136,7 @@ export const suggestVariants = async ({
filePath: z.string(),
}),
)
.optional(),
.nullable(),
}),
),
});