airbytehq / airbytehq/PyAirbyte

Bug: Secret references to non-string fields are injected as strings, causing validation failures

未关闭
#852 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
bug enhancement
主要语言
Python
星标
344
派生
77
平均合并
1 天 11 小时
30 天内合并 PR
35

描述

## Description

When a secret reference is used to point to a non-string field (such as 'port'), the value is injected as a string. This can cause validation to fail due to type mismatch.

## Example

If a connector config has a numeric field like `port` and it's provided via secret reference:
```json
{
"host": "localhost",
"port": "secret_reference::MY_PORT_SECRET"
}
```

The secret value is injected as a string (e.g., `"5432"`) instead of being cast to the correct type (e.g., `5432`), causing JSON schema validation to fail.

## Proposed Solution

Use the connector's JSON schema (from `connectionSpecification`) to infer when a secret reference needs to be cast to a numeric type rather than keeping it as a string.

For now, we can focus on the generic numeric type and ignore other types.

## Context

This is relevant to the work in #850 and PR #851, where we're adding the ability to fetch connector specs from the registry. Having access to the JSON schema enables proper type casting of secret references without requiring local connector execution.

## Related

- Issue #850
- PR #851

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。