Unstructured-IO / Unstructured-IO/unstructured-python-client
bug/SaaS API Kafka Cloud Connector inconsistency
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 119
- Fork
- 22
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Describe the bug
When attempting to create a Kafka Cloud source connector directly with the API, there appears to be no minimum viable configuration that can successfully create the connector because the server is inconsistent about the requirement for a bootstrap_server{,s} key.
First, attempting to create the connector with bootstrap_servers:
POST /api/v1/sources/ HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 168
Content-Type: application/json
Host: platform.unstructuredapp.io
User-Agent: HTTPie/3.2.4
unstructured-api-key: ******
{
"config": {
"bootstrap_servers": "https://example.com",
"kafka_api_key": "foo",
"secret": "foo",
"topic": "foo"
},
"name": "test-kafka-connector",
"type": "kafka-cloud"
}
HTTP/1.1 412 Precondition Failed
content-length: 71
content-type: application/json
date: Wed, 20 Aug 2025 20:22:42 GMT
server: istio-envoy
x-envoy-upstream-service-time: 50
{
"errors": [
{
"field": "bootstrap_server",
"message": "Field is required"
}
]
}
The error message indicates that it should be bootstrap_server.
POST /api/v1/sources/ HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 167
Content-Type: application/json
Host: platform.unstructuredapp.io
User-Agent: HTTPie/3.2.4
unstructured-api-key: ******
{
"config": {
"bootstrap_server": "https://example.com",
"kafka_api_key": "foo",
"secret": "foo",
"topic": "foo"
},
"name": "test-kafka-connector",
"type": "kafka-cloud"
}
HTTP/1.1 422 Unprocessable Entity
content-length: 191
content-type: application/json
date: Wed, 20 Aug 2025 20:23:50 GMT
server: istio-envoy
x-envoy-upstream-service-time: 80
{
"detail": [
{
"input": {
"bootstrap_server": "https://example.com",
"kafka_api_key": "foo",
"secret": "foo",
"topic": "foo"
},
"loc": [
"body",
"bootstrap_servers"
],
"msg": "Field required",
"type": "missing"
}
]
}
Now the error message says that bootstrap_servers is missing.
To Reproduce
Using HTTPie:
$ http -jv POST https://platform.unstructuredapp.io/api/v1/sources/ unstructured-api-key:$UNSTRUCTURED_API_KEY name=test-kafka-connector type=kafka-cloud config:='{"topic":"foo","kafka_api_key":"foo","secret":"foo","bootstrap_servers":"https://example.com"}'
$ http -jv POST https://platform.unstructuredapp.io/api/v1/sources/ unstructured-api-key:$UNSTRUCTURED_API_KEY name=test-kafka-connector type=kafka-cloud config:='{"topic":"foo","kafka_api_key":"foo","secret":"foo","bootstrap_server":"https://example.com"}'
Expected behavior
One of these two should have worked, or should have moved on to some other validation message.
Additional context
Documentation for the source connector shows the singular bootstrap_connector. The Python SDK uses the plural bootstrap_connectors.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng việc tái hiện POST /api/v1/sources/ và so sánh các lỗi validation ở dạng số ít và số nhiều. Kiểm tra src/unstructured_client/models/shared/kafkacloudsourceconnectorconfiginput.py và so sánh với tài liệu Kafka source connector được liên kết; hoàn tất khi tên trường được chấp nhận và hành vi validation nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- kafka, python
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100