diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index a1897a6..67178ae 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -114,9 +114,16 @@ export const VertexProviderSettingSchema = z.object({ export const ProviderSettingSchema = z.union([ // Must use more specific type first! // Zod uses the first type that matches. - AzureProviderSettingSchema, - VertexProviderSettingSchema, - RegularProviderSettingSchema, + // + // We use passthrough as a hack because Azure and Vertex + // will match together since their required fields overlap. + // + // In addition, there may be future provider settings that + // we may want to preserve (e.g. user downgrades to older version) + // so doing passthrough keeps these extra fields. + AzureProviderSettingSchema.passthrough(), + VertexProviderSettingSchema.passthrough(), + RegularProviderSettingSchema.passthrough(), ]); /**